Skip to content
This repository
Browse code

Give more info on missing gems and abort instead of printing a warnin…

…g. App can begin in incomplete state otherwise.
  • Loading branch information...
commit 0dcc81a84d8895c7cfac5221808dfcb0514f6673 1 parent 3f48a97
Jeremy Kemper jeremy authored

Showing 1 changed file with 10 additions and 5 deletions. Show diff stats Hide diff stats

  1. +10 5 railties/lib/initializer.rb
15 railties/lib/initializer.rb
@@ -255,11 +255,16 @@ def check_gem_dependencies
255 255 @gems_dependencies_loaded = false
256 256 # don't print if the gems rake tasks are being run
257 257 unless $rails_gem_installer
258   - puts %{These gems that this application depends on are missing:}
259   - unloaded_gems.each do |gem|
260   - puts " - #{gem.name}"
261   - end
262   - puts %{Run "rake gems:install" to install them.}
  258 + abort <<-end_error
  259 +Missing these required gems:
  260 + #{unloaded_gems.map { |gem| "#{gem.name} #{gem.requirement}" } * "\n "}
  261 +
  262 +You're running:
  263 + ruby #{Gem.ruby_version} at #{Gem.ruby}
  264 + rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
  265 +
  266 +Run `rake gems:install` to install the missing gems.
  267 + end_error
263 268 end
264 269 else
265 270 @gems_dependencies_loaded = true

0 comments on commit 0dcc81a

Please sign in to comment.
Something went wrong with that request. Please try again.