aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-05-15 00:24:51 -0700
committerJosé Valim <jose.valim@gmail.com>2012-05-15 00:24:51 -0700
commit0be7fabd4eb77828e7deff7513faa3834d1a021a (patch)
treeb33164436933f4c6203f4c2127eb2fbb062846ae
parent3bc73df409974c2f6821203bc1abd1ee9678ccac (diff)
parentaed906af97cfa86801951a6a97251084fac6dc57 (diff)
downloadrails-0be7fabd4eb77828e7deff7513faa3834d1a021a.tar.gz
rails-0be7fabd4eb77828e7deff7513faa3834d1a021a.tar.bz2
rails-0be7fabd4eb77828e7deff7513faa3834d1a021a.zip
Merge pull request #6318 from mpapis/master
fix `bundle exec rails new app` not running `bundle install` properly
-rw-r--r--railties/lib/rails/generators/app_base.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 2c1742c6be..d661c62148 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -246,8 +246,16 @@ module Rails
# is easier to silence stdout in the existing test suite this way. The
# end-user gets the bundler commands called anyway, so no big deal.
#
+ # We unset temporary bundler variables to load proper bundler and Gemfile.
+ #
# Thanks to James Tucker for the Gem tricks involved in this call.
+
+ bundle_gemfile, rubyopt = ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT']
+ ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT'] = "", ""
+
print `"#{Gem.ruby}" "#{Gem.bin_path('bundler', 'bundle')}" #{command}`
+
+ ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT'] = bundle_gemfile, rubyopt
end
def run_bundle