Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added the 2.3 stuff for bundler to Radiant

  • Loading branch information...
commit b0472f5c27a1701ecc05918f8da073877fdb7e98 1 parent e7c0a3b
Danish Khan authored
Showing with 34 additions and 0 deletions.
  1. +14 −0 config/boot.rb
  2. +20 −0 config/preinitializer.rb
View
14 config/boot.rb
@@ -158,5 +158,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:
Radiant.boot!
View
20 config/preinitializer.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.