Space Vatican

Ramblings of a curious coder

When Aptana Messes With Your Gems

Recently a fair few people on rubyonrails-talk have been getting strange error messages about config.time_zone or referring to funny versions of gems (like rails This rather suggests that they were using edge versions of rails (since config.time_zone is an edge thing, and rails means ‘the edge gem from revision 9216). These edge gems come from But why were so many people suddenly doing this, all at the same time ?

It turns out that in its infinite wisdom Aptana silently adds to your gem sources. If you remove, Aptana will put it back. Don’t ask me why, it’s madness as far as I can tell. So you gem edge rails gems installed, thus the rails command now refers to edge rails and generates you an envionment.rb suitable for edge rails (including the config.time_zone line). The gem version specified in environment.rb is still 2.0.2 though, so your app loads 2.0.2 which doesn’t know about the edge features. Failure.

So, to fix this: * Uninstall all the edge gems (the ones with versions like (the last number may vary) * Remove from your gem sources: gem sources -r * (Optional) get rid of Aptana, since it will keep adding (or wait for the version that fixes this)

You might also want to recreate your app as the environment.rb that edge rails created for you will not work with rails 2.0.2