From a54654de1c9c11d20b4359c4aa01a6dac55aa0cf Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sun, 31 Jan 2010 19:40:45 -0800 Subject: Update the generated Gemfile and config/boot.rb to work with bundler 0.9 --- .../generators/rails/app/templates/config/boot.rb | 25 ++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'railties/lib/generators/rails/app/templates/config/boot.rb') diff --git a/railties/lib/generators/rails/app/templates/config/boot.rb b/railties/lib/generators/rails/app/templates/config/boot.rb index 7fc1aeaeb8..70bd40bc4c 100644 --- a/railties/lib/generators/rails/app/templates/config/boot.rb +++ b/railties/lib/generators/rails/app/templates/config/boot.rb @@ -1,16 +1,19 @@ # Use Bundler (preferred) -environment = File.expand_path('../../vendor/gems/environment', __FILE__) -if File.exist?("#{environment}.rb") - require environment - -# 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 - +begin + require File.expand_path('../../vendor/environment', __FILE__) +rescue LoadError require 'rubygems' + require 'bundler' + Bundler.setup + + # To use 2.x style vendor/rails and RubyGems + # + # vendor_rails = File.expand_path('../../vendor/rails', __FILE__) + # if File.exist?(vendor_rails) + # Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) } + # end + # + # require 'rubygems' end <% unless options[:skip_activerecord] -%> -- cgit v1.2.3