Skip to content

Instantly share code, notes, and snippets.

@lifo
Created January 1, 2010 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifo/267160 to your computer and use it in GitHub Desktop.
Save lifo/267160 to your computer and use it in GitHub Desktop.
diff --git a/railties/lib/rails/generators/rails/app/templates/config/boot.rb b/railties/lib/rails/generators/rails/app/templates/config/boot.rb
index 6de1725..0240289 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/boot.rb
+++ b/railties/lib/rails/generators/rails/app/templates/config/boot.rb
@@ -6,11 +6,18 @@ if File.exist?("#{environment}.rb")
# Use 2.x style vendor/rails and RubyGems
else
vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
- if File.exist?(vendor_rails)
- Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
- end
- require 'rubygems'
+ bundler_env = File.join(vendor_rails, "vendor/gems/environment.rb")
+
+ if File.exist?(bundler_env)
+ require bundler_env
+ else
+ if File.exist?(vendor_rails)
+ Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
+ end
+
+ require 'rubygems'
+ end
end
require 'rails/all'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment