Skip to content

Commit

Permalink
Give more info on missing gems and abort instead of printing a warnin…
Browse files Browse the repository at this point in the history
…g. App can begin in incomplete state otherwise.
  • Loading branch information
jeremy committed Jul 15, 2008
1 parent b337ab0 commit 1edb5c8
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions railties/lib/initializer.rb
Expand Up @@ -266,11 +266,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
Expand Down

2 comments on commit 1edb5c8

@darragh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful.

Looks like there’s now an oppurtunity to remove the gems_dependencies_loaded attribute? since we’re aborting it’s no longer used.

@jeremy
Copy link
Member Author

@jeremy jeremy commented on 1edb5c8 Aug 26, 2008

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point darragh. Thanks :)

Please sign in to comment.