ruby 1.9, rails 2.3.5, and cucumber

February 25, 2010

in software,web

My toy of the day is cucumber, a very intriguing BDD framework for ruby (and rails). I had quickly looked at a few screencasts and decided to jump right in, and did this:

sudo gem install cucumber

and right away, did this in a freshly made rails app folder:

script/generate cucumber

It’s probably not surprising to those more versed in cucumber that I ended up with:

Couldn't find 'cucumber' generator

Turns out, after version 0.4.5 (i think?) you need an additional gem…

sudo gem install cucumber-rails

Dur… I wasted a good 20 minutes figuring out the (apparently) obvious.

As a side note, if you’re a TextMate fan like myself, this bundle is really neat when working on cucumber feature files.

Cheers!

{ 5 comments… read them below or add one }

makuchaku March 15, 2010 at 12:53 am

First time with cucumber and I faced exactly the same problem. Thanks for sharing the solution :)

Maku

matt March 15, 2010 at 3:21 am

no problem! i know how annoying these little “gotchas” can be…

jim March 26, 2010 at 6:22 pm

Very annoying! Thanks!

zak April 20, 2010 at 11:49 pm

thanks for the tip. however – i’m trying to follow ryan bates’ railscast about cucumber.

but as soon as i define my step definition and run “cucumber features” i get “Anonymous modules have no name to be referenced by (ArgumentError).”

if i rvm to Ruby 1.8.7 and run the same command – i get the proper error.

Any ideas? I am running Ruby 1.9.1 with Rails 2.3.5 and have all the required gems installed.

matt April 21, 2010 at 1:38 pm

i think i’ve seen this once quite a while ago — sorry i forget how i got around it. i believe it had something to do with additional libs i was including in my project — check your dependencies, and make sure they’re loading properly. try using the rails console, and accessing any plugins or add-ons in your project, to ensure they’re loaded. probably not much help, but there ya go!

Leave a Comment

Previous post:

Next post: