Diff
Modified: trunk/Rakefile (3609 => 3610)
--- trunk/Rakefile 2013-07-18 07:52:48 UTC (rev 3609)
+++ trunk/Rakefile 2013-07-18 12:40:29 UTC (rev 3610)
@@ -6,9 +6,11 @@
require 'rake'
require 'rake/testtask'
require 'rdoc/task'
-
require 'tasks/rails'
+require 'sunspot/rails/tasks'
+require 'sunspot/solr/tasks'
+
desc 'Rebuild Solr index'
task "myexp:refresh:solr" do
require File.dirname(__FILE__) + '/config/environment'
Modified: trunk/config/boot.rb (3609 => 3610)
--- trunk/config/boot.rb 2013-07-18 07:52:48 UTC (rev 3609)
+++ trunk/config/boot.rb 2013-07-18 12:40:29 UTC (rev 3610)
@@ -110,5 +110,19 @@
end
end
+class Rails::Boot
+ def run
+ load_initializer
+
+ Rails::Initializer.class_eval do
+ def load_gems
+ @bundler_loaded ||= Bundler.require :default, Rails.env
+ end
+ end
+
+ Rails::Initializer.run(:set_load_path)
+ end
+end
+
# All that for this:
Rails.boot!
Added: trunk/config/preinitializer.rb (0 => 3610)
--- trunk/config/preinitializer.rb (rev 0)
+++ trunk/config/preinitializer.rb 2013-07-18 12:40:29 UTC (rev 3610)
@@ -0,0 +1,23 @@
+# Load gems from Gemfile.
+# From: http://bundler.io/rails23.html
+
+begin
+ require 'rubygems'
+ require 'bundler'
+rescue LoadError
+ raise "Could not load the bundler gem. Install it with `gem install bundler`."
+end
+
+if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
+ raise RuntimeError, "Your bundler version is too old for Rails 2.3.\n" +
+ "Run `gem install bundler` to upgrade."
+end
+
+begin
+ # Set up load paths for all bundled gems
+ ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
+ Bundler.setup
+rescue Bundler::GemNotFound
+ raise RuntimeError, "Bundler couldn't find some gems.\n" +
+ "Did you run `bundle install`?"
+end
Modified: trunk/lib/pivoting.rb (3609 => 3610)
--- trunk/lib/pivoting.rb 2013-07-18 07:52:48 UTC (rev 3609)
+++ trunk/lib/pivoting.rb 2013-07-18 12:40:29 UTC (rev 3610)
@@ -195,6 +195,7 @@
end
rescue
+ raise unless Rails.env == "production"
return false
end