This project is archived and is in readonly mode.
Increase error message output in boot.rb
-
David Trasbo
- Assigned user set to José Valim
- Importance changed from to
A better solution is to simply re-raise the
Gem::LoadError. I've attached a patch that does just that.Other than that I definitely think it's a useful change. Pre-Bundler I often spent hours debugging the cause of this often in-sufficient/vague error message.
-
José Valim
- Milestone changed from 3.x to 2.3.9
I think that showing the install rails 2.2.2 when it is already installed is confusing in any occasion. So, ideally, we should check the reason the gem failed loading and if the reason is because it's really missing, we show the current message, otherwise, we simply re-raise the original error.
-
David Trasbo
Definitely a good point. I've attached another patch that tells the user that the Rails gem is missing if that's the case, otherwise it simply re-raises the
Gem::LoadError. -
Lenary
David, just had a look at that patch,
you might want to re-examine the regular expression. what if the list of unfound rubygems is longer than rails, and there is something between the "Could not find RubyGem" and the word rails.
This said, i don't know if that could ever happen...
-
David Trasbo
I see your point, but basically: No, it can't. :)
Sure, one of the dependencies (activesupport, actionpack, etc.) could be missing, but if the Rails gem itself is missing the code will not know it, because the dependencies are defined within the Rails gem.
You can try it by installing Rails (version 2.2.2, for example, doesn't really matter), uninstall the Rails gem itself and one or more of the dependencies. The
Gem::LoadErrormessage will be the same, because it's unaware of which gems Rails depends on and therefore doesn't care if they're installed. -
Repository
- State changed from new to committed
(from [d0d10f51d7b2edea94a00291d79cad769d8a6470]) Only tell users that the Rails gem is missing if it's actually the case [#2901 state:committed]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/d0d10f51d7b2edea94a00291d79cad...
