Skip to content

Commit 3072bf7

Browse files
committed
Check for bundler environment or 2.x-style vendor/rails + rubygems
1 parent a49c3b0 commit 3072bf7

File tree

1 file changed

+8
-10
lines changed
  • railties/lib/rails/generators/rails/app/templates/config

1 file changed

+8
-10
lines changed

railties/lib/rails/generators/rails/app/templates/config/boot.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
# Package management
2-
# Choose one
3-
1+
# Use Bundler (preferred)
42
environment = File.expand_path('../../vendor/gems/environment', __FILE__)
5-
vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
6-
73
if File.exist?(environment)
8-
# Use Bundler (preferred)
94
require environment
10-
elsif File.exist?(vendor_rails)
11-
# Use 2.x style vendor/rails directory
12-
Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
5+
6+
# Use 2.x style vendor/rails and RubyGems
137
else
14-
# Load Rails from traditional RubyGems
8+
vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
9+
if File.exist?(vendor_rails)
10+
Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
11+
end
12+
1513
require 'rubygems'
1614
end
1715

0 commit comments

Comments
 (0)