Permalink
Browse files

[FIX] boot

  • Loading branch information...
1 parent 3d623d5 commit 95bb49624ede8667fcb543c21c0f1a60727cffcb Elad Meidar committed Apr 30, 2012
Showing with 34 additions and 0 deletions.
  1. +14 −0 config/boot.rb
  2. +20 −0 config/preinitializer.rb
View
@@ -106,5 +106,19 @@ def read_environment_rb
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!
View
@@ -0,0 +1,20 @@
+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." +
+ "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." +
+ "Did you run `bundle install`?"
+end

0 comments on commit 95bb496

Please sign in to comment.