Skip to content
Browse files

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

…g. App can begin in incomplete state otherwise.
  • Loading branch information...
1 parent 3f48a97 commit 0dcc81a84d8895c7cfac5221808dfcb0514f6673 @jeremy jeremy committed Jul 15, 2008
Showing with 10 additions and 5 deletions.
  1. +10 −5 railties/lib/initializer.rb
View
15 railties/lib/initializer.rb
@@ -255,11 +255,16 @@ def check_gem_dependencies
@gems_dependencies_loaded = false
# don't print if the gems rake tasks are being run
unless $rails_gem_installer
- puts %{These gems that this application depends on are missing:}
- unloaded_gems.each do |gem|
- puts " - #{gem.name}"
- end
- puts %{Run "rake gems:install" to install them.}
+ abort <<-end_error
+Missing these required gems:
+ #{unloaded_gems.map { |gem| "#{gem.name} #{gem.requirement}" } * "\n "}
+
+You're running:
+ ruby #{Gem.ruby_version} at #{Gem.ruby}
+ rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
+
+Run `rake gems:install` to install the missing gems.
+ end_error
end
else
@gems_dependencies_loaded = true

0 comments on commit 0dcc81a

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