diff options
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/gem_dependency.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/gem_dependency.rb b/railties/lib/rails/gem_dependency.rb index 2034841cd2..22ee0e3601 100644 --- a/railties/lib/rails/gem_dependency.rb +++ b/railties/lib/rails/gem_dependency.rb @@ -73,7 +73,9 @@ module Rails end def install - Gem::GemRunner.new.run(install_command) + cmd = "#{gem_command} #{install_command.join(' ')}" + puts cmd + puts %x(#{cmd}) end def unpack_to(directory) @@ -100,10 +102,14 @@ private ################################################################### def specification @spec ||= Gem.source_index.search(Gem::Dependency.new(@name, @requirement)).sort_by { |s| s.version }.last end + + def gem_command + RUBY_PLATFORM =~ /win32/ ? 'gem.bat' : 'gem' + end def install_command cmd = %w(install) << @name - cmd << "--version" << "#{@requirement.to_s}" if @requirement + cmd << "--version" << %("#{@requirement.to_s}") if @requirement cmd << "--source" << @source if @source cmd end |