You shouldn't be seeing this problem with 2.3.2 - I just tried it in a
fresh Rails app using the 2.3.2 gem. Something weird's going on in
your version, as the install task sets $gems_rake_task which *should*
prevent the display of the error message you're seeing.
Do you happen to have an RC version frozen in vendor/rails? That's my
next guess...
I have exactly the same problem with Rails 2.3.2. Since it is an open
source project, you can easily grab it from here and verify for
yourself the problem:
Ari: your problem is in lib/tasks/localization.rake. You require
config/environment, which loads the initializer and causes the error.
The gems tasks never even get a chance to run.
Troels - I'd recommend that you look for the same kind of thing in
your Rakefiles.
Matt: thank you so much for finding that. I have removed it and the
problem goes away as you say. Can I recommend some improvements to
Rails to help others in this predicament:
* rake gems:install should not try to load all the rake tasks since it
has a very specific job to do and should not be sidetracked by loading
everything it comes across on the class path
* better error reporting which detects this condition and reports
where the problem might lie
FYI, I have created a plugin, that moves gem-dependencies into a
separate file (`config/gemconf.rb`) and then makes `script/install_gems`
use this file for finding dependencies. This makes the install script
completely independent of rake and any rake tasks.