Skip to content

Commit a54654d

Browse files
author
Carl Lerche
committed
Update the generated Gemfile and config/boot.rb to work with bundler 0.9
1 parent 4cbb9db commit a54654d

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

railties/lib/generators/rails/app/templates/Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Edit this Gemfile to bundle your application's dependencies.
2+
source :gemcutter
3+
24
<% if !dev_or_edge? %>
35
gem "rails", "<%= Rails::VERSION::STRING %>"
46
<% end -%>

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# Use Bundler (preferred)
2-
environment = File.expand_path('../../vendor/gems/environment', __FILE__)
3-
if File.exist?("#{environment}.rb")
4-
require environment
5-
6-
# Use 2.x style vendor/rails and RubyGems
7-
else
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-
2+
begin
3+
require File.expand_path('../../vendor/environment', __FILE__)
4+
rescue LoadError
135
require 'rubygems'
6+
require 'bundler'
7+
Bundler.setup
8+
9+
# To use 2.x style vendor/rails and RubyGems
10+
#
11+
# vendor_rails = File.expand_path('../../vendor/rails', __FILE__)
12+
# if File.exist?(vendor_rails)
13+
# Dir["#{vendor_rails}/*/lib"].each { |path| $:.unshift(path) }
14+
# end
15+
#
16+
# require 'rubygems'
1417
end
1518

1619
<% unless options[:skip_activerecord] -%>

0 commit comments

Comments
 (0)