cc.rb, rspec, rake, gem… oh man

I just wanted to install CruiseControl.rb, then I realized I need to fix rake in my project first. For some reason, rake didn’t pick up the gem path (while running the single test/spec class in NetBeans is OK). I guess the reason is that I have multiple versions of ruby environment on same PC.

If it’s only one ruby environment, the only thing I need to do for windows ruby dev is to add a “RUBYOPT=rubygems” environment variable.

This problem is complicated for multiple ruby env. To simplify it, I manually set my preferred/primary ruby env to PATH var, or move it to first spot. This can make sure both rake and gem are pointing to the same ruby I was working on.

While updating gems, I noticed there is a new version 2.2 of rspec. So I uninstalled the old one 1.3, which is a disaster, because 1.3 to 2.2 is a broken upgrade. spec is gone (renamed to rspec), but NetBeans still trys to find the old spec… I’m hooked.

Fortunately I still have another ruby env, re-do the environment variables, rake is back to live.

The logic of looking for rake task in cc.rb is weird, test->default->…, what I really want is spec, so I set task :default=>[:spec], because test task is still there, so the default spec task couldn’t be picked up by cc.rb.

Good thing this is still configurable:

project.rake_task = 'spec'

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s