diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-02-02 13:30:08 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-02-02 13:30:08 +1100 |
commit | 535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81 (patch) | |
tree | dcbd2acf8e83493eea719bf0a0c51a9c121bf194 /railties/lib/generators/rails/app/templates/config | |
parent | 49a26c533366eff63acd3c99ed0dffc04f85f55c (diff) | |
parent | 9b5dae7af5757769c1e69d74a59ff036adc1f30f (diff) | |
download | rails-535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81.tar.gz rails-535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81.tar.bz2 rails-535ae3b946b387af7eb6cb4bb4aed3d5cac1cf81.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/lib/generators/rails/app/templates/config')
-rw-r--r-- | railties/lib/generators/rails/app/templates/config/boot.rb | 25 |
1 files changed, 14 insertions, 11 deletions
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] -%> |