aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/generators/rails/app/templates/Gemfile2
-rw-r--r--railties/lib/generators/rails/app/templates/config/boot.rb25
2 files changed, 16 insertions, 11 deletions
diff --git a/railties/lib/generators/rails/app/templates/Gemfile b/railties/lib/generators/rails/app/templates/Gemfile
index 7b5c89c3e2..4db2b3e46c 100644
--- a/railties/lib/generators/rails/app/templates/Gemfile
+++ b/railties/lib/generators/rails/app/templates/Gemfile
@@ -1,4 +1,6 @@
# Edit this Gemfile to bundle your application's dependencies.
+source :gemcutter
+
<% if !dev_or_edge? %>
gem "rails", "<%= Rails::VERSION::STRING %>"
<% end -%>
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] -%>