aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/app_base.rb
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-06-25 06:57:11 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-08-31 20:51:37 +0200
commit414158805fe9ffed253c7afc665b573c0ba3c6be (patch)
treee30a4f299c226284c53c293c39c57b2d603e974b /railties/lib/rails/generators/app_base.rb
parent85098e4b31263b04200cb9ac8406c9b2a38cce35 (diff)
downloadrails-414158805fe9ffed253c7afc665b573c0ba3c6be.tar.gz
rails-414158805fe9ffed253c7afc665b573c0ba3c6be.tar.bz2
rails-414158805fe9ffed253c7afc665b573c0ba3c6be.zip
Revert "Revert changes related to `bundle install` fixes in `rails new`"
The cause of the previous revert was bug in bundler that made it hard to make railties test work. Fix for bundler was recently pushed to github, so now we can safely get back to the original commit. This reverts commit 0f5cc34ab58cda99d1401ecc82e1ebb873838dd7.
Diffstat (limited to 'railties/lib/rails/generators/app_base.rb')
-rw-r--r--railties/lib/rails/generators/app_base.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb
index 383bea9e54..84de254f2f 100644
--- a/railties/lib/rails/generators/app_base.rb
+++ b/railties/lib/rails/generators/app_base.rb
@@ -246,8 +246,17 @@ 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.
- print `"#{Gem.ruby}" "#{Gem.bin_path('bundler', 'bundle')}" #{command}`
+ _bundle_command = Gem.bin_path('bundler', 'bundle')
+
+ bundle_bin_path, bundle_gemfile, rubyopt = ENV['BUNDLE_BIN_PATH'], ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT']
+ ENV['BUNDLE_BIN_PATH'], ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT'] = "", "", ""
+
+ print `"#{Gem.ruby}" "#{_bundle_command}" #{command}`
+
+ ENV['BUNDLE_BIN_PATH'], ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT'] = bundle_bin_path, bundle_gemfile, rubyopt
end
def run_bundle