1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
Description: Be careful with that bundler
on Debian, Rails must preferably use Debian packages, while not stopping the
users to get stuff from Rubygems if they want.
.
This way, when creating a new application, we run `bundle install --local`
instead of `bundle install`, to make sure bundler does not download anything
from Rubygems. That's not because I don't like Rubygems, but because
everything the user will need to run this new app (sqlite3, sass-rails,
coffee-rails) is already installed by means of Debian packages. If the user
does want to use Rubygems packages after that, she will just edit the Gemfile,
run `bundle install`, and bundler will do its thing as usual.
.
This is patch is most probably Debian-specific.
Author: Antonio Terceiro <terceiro@debian.org>
--- rails.orig/railties/lib/rails/generators/app_base.rb
+++ rails/railties/lib/rails/generators/app_base.rb
@@ -323,11 +323,9 @@ module Rails
# We unset temporary bundler variables to load proper bundler and Gemfile.
#
# Thanks to James Tucker for the Gem tricks involved in this call.
- _bundle_command = Gem.bin_path('bundler', 'bundle')
-
require 'bundler'
Bundler.with_clean_env do
- output = `"#{Gem.ruby}" "#{_bundle_command}" #{command}`
+ output = `"#{Gem.ruby}" "/usr/bin/bundle" #{command}`
print output unless options[:quiet]
end
end
@@ -341,7 +339,7 @@ module Rails
end
def run_bundle
- bundle_command('install') if bundle_install?
+ bundle_command('install --local') if bundle_install?
end
def generate_spring_binstubs
|