Forum: RSpec Cucumber autotest load error between 0.1.8 and 0.1.9

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Harry L. (Guest)
on 2008-11-18 05:26
(Received via mailing list)

I'm new to the list and to Cucumber (and RSpec and testing in general)
so I apologize if this has already come up. I searched the archive and
didn't see anything.

Last week I installed Cucumber 0.1.8 for my Rails app and both
'cucumber features' and 'rake features' worked fine. Features and
steps were evaluated.

Today I upgraded Cucumber to 0.1.9 and tried to set up autotest. It
didn't work.

Long story short, I installed the gems but didn't put them in my
vendor/plugins directory (by choice). In 0.1.8, script/cucumber was
only looking in vendor/plugins. In 0.1.9, there's a LoadError
exception rescue that defaults to the local gem if it can't be found
in vendor/plugins.

#!/usr/bin/env ruby
load File.expand_path(File.dirname(__FILE__) +

#!/usr/bin/env ruby
  load File.expand_path(File.dirname(__FILE__) +
rescue LoadError
  require "rubygems"
  load File.join(Gem.bindir, "cucumber")

I hope that helps somebody else.

Peter J. (Guest)
on 2008-11-18 16:57
(Received via mailing list)
On Mon, Nov 17, 2008 at 10:19 PM, Harry L. 

> in vendor/plugins.
Could you explain what doesn't work when you run autotest?  Or, I
suppose, what it *does* do? :)

Also, does `script/cucumber features` work?

Harry L. (Guest)
on 2008-11-18 17:38
(Received via mailing list)
On Tue, Nov 18, 2008 at 7:56 AM, Peter J. <removed_email_address@domain.invalid>
> Could you explain what doesn't work when you run autotest?  Or, I
> suppose, what it *does* do? :)
> Also, does `script/cucumber features` work?

I originally ran 'script/generate cucumber' under 0.1.8. The
script/cucumber executable created by that process looks in
vendor/plugins for the gem and doesn't include the rescue from
LoadError if it's not found.

Yesterday I upgraded to 0.1.9. I was not aware that I needed to re-run
'script/generate cucumber' again for my app. Doing so solved the
problem because it updated the script/cucumber executable which now
includes the rescue clause.

'script/cucumber features' works now, as does autotest. Before the
update I was running 'rake features' and 'cucumber features' manually,
both of which point to the gem, so I never received an error.

I only noticed the problem when I tried to use autotest because it
calls script/cucumber which, until I regenerated the cucumber code,
only looked in vendor/plugins for the gem. So a LoadError exception
was being thrown.

This topic is locked and can not be replied to.