public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Give more info on missing gems and abort instead of printing a warning. App can 
begin in incomplete state otherwise.
jeremy (author)
Tue Jul 15 15:50:37 -0700 2008
commit  1edb5c85b58653a6fdc73ae1c6c63e317b466b27
tree    d55c7a757e67ab1bcbe6dd92a8a6c8d94a9ace2c
parent  b337ab0221085ab1a941d87f06eb4904b5852c82
...
266
267
268
269
270
271
272
273
 
 
 
 
 
 
 
 
 
 
274
275
276
...
266
267
268
 
 
 
 
 
269
270
271
272
273
274
275
276
277
278
279
280
281
0
@@ -266,11 +266,16 @@ module Rails
0
         @gems_dependencies_loaded = false
0
         # don't print if the gems rake tasks are being run
0
         unless $rails_gem_installer
0
-          puts %{These gems that this application depends on are missing:}
0
-          unloaded_gems.each do |gem|
0
-            puts " - #{gem.name}"
0
-          end
0
-          puts %{Run "rake gems:install" to install them.}
0
+          abort <<-end_error
0
+Missing these required gems:
0
+  #{unloaded_gems.map { |gem| "#{gem.name}  #{gem.requirement}" } * "\n  "}
0
+
0
+You're running:
0
+  ruby #{Gem.ruby_version} at #{Gem.ruby}
0
+  rubygems #{Gem::RubyGemsVersion} at #{Gem.path * ', '}
0
+
0
+Run `rake gems:install` to install the missing gems.
0
+          end_error
0
         end
0
       else
0
         @gems_dependencies_loaded = true

Comments

darragh Tue Aug 26 01:54:00 -0700 2008

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 Tue Aug 26 13:55:30 -0700 2008

Good point darragh. Thanks :)