new rails, now with a rake gotcha

Well, there's a release candidate for Rails 1.1 now. Being a good... err... Rails person... I went ahead and did a rake freeze_edge. I was rewarded with something like this:

$ script/server
=> Booting lighttpd (use 'script/server webrick' to force WEBrick)
./script/../config/../vendor/rails/railties/lib/commands/../tasks/tmp.rake: 1:
    undefined method namespace for main: Object (NoMethodError)
  from ./script/../config/../vendor/rails/activesupport
    /lib/active_support/dependencies.rb: 142: in load
  from ./script/../config/../vendor/rails/railties/lib/commands/server.rb: 29
  from script/server: 3

I know, you're probably thinking to yourself "Good grief, did he forget to update rake to 0.7? It's mentioned in the release notes, the blog posting, and everywhere else." The thing is, you can get this error even if you've done a gem install rake. (Strange, but true!) Since freeze_edge puts everything in vendor/, it doesn't use gems. Since it doesn't use gems, it will try to use whatever rake is installed on your system through your package manager. (Thanks to danp from #caboose for pointing this out.) The best thing to do is to just get rid of the non-gem rake and rely only on the gem one.

Update: I was also having all my tests fail when running the freeze_edge version, but the problems went away when I did the regular gem install rails --source I know that's not practical for everyone, but seems to be the most trouble-free way if you can do it.

« older | 2006-03-22T11:36:40Z | newer »