Unable to run examples

1,438 views
Skip to first unread message

win

unread,
Feb 8, 2011, 12:56:06 AM2/8/11
to Cukes
I'm new in ruby/watir and I am trying to learn cucumber here.
Following the instructions from http://wiki.openqa.org/display/WTR/Install+Ruby,
I installed Ruby 1.9.1 p430 and watir 1.7.1. sucessfully. Then I
installed cucumber 0.9.0. Using this version, I am able to run the
command "cucumber --help".

The next thing I am trying to do is to run cucumber examples.
According to https://github.com/aslakhellesoy/cucumber/wiki/
I should be able to run cucumber command in each of the examples
directory. So I went to the examples directory and try to run the
command. However, I keep getting below error when running the
examples.

C:\ruby186\lib\ruby\gems\1.9.1\gems\cucumber-0.9.0\examples
\watir>cucumber ./features/search.feature
Using the default profile...
no such file to load -- spec/expectations (LoadError)
C:/ruby186/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'
C:/ruby186/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/examples/watir/
features/support/env.rb:1:in `rescue in <top (required)>'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/examples/watir/
features/support/env.rb:1:in `<top (required)>'
C:/ruby186/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'
C:/ruby186/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:29:in
`require'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
rb_support/rb_language.rb:142:in `load_code_file'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/support_code.rb:147:in `load_file'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/support_code.rb:61:in `block in load_files!'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/support_code.rb:60:in `each'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/support_code.rb:60:in `load_files!'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime.rb:184:in `load_step_definitions'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime.rb:26:in `run!'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/cli/
main.rb:54:in `execute!'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/cli/
main.rb:29:in `execute'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/bin/cucumber:8:in
`<top (required)>'
C:/ruby186/bin/cucumber:19:in `load'
C:/ruby186/bin/cucumber:19:in `<main>'

Can someone shed me a light here?

Thanks,
Win

Matt Wynne

unread,
Feb 8, 2011, 5:16:10 AM2/8/11
to cu...@googlegroups.com

On 8 Feb 2011, at 05:56, win wrote:

> I'm new in ruby/watir and I am trying to learn cucumber here.
> Following the instructions from http://wiki.openqa.org/display/WTR/Install+Ruby,
> I installed Ruby 1.9.1 p430 and watir 1.7.1. sucessfully. Then I
> installed cucumber 0.9.0. Using this version, I am able to run the
> command "cucumber --help".
>
> The next thing I am trying to do is to run cucumber examples.
> According to https://github.com/aslakhellesoy/cucumber/wiki/
> I should be able to run cucumber command in each of the examples
> directory. So I went to the examples directory and try to run the
> command. However, I keep getting below error when running the
> examples.
>
> C:\ruby186\lib\ruby\gems\1.9.1\gems\cucumber-0.9.0\examples
> \watir>cucumber ./features/search.feature
> Using the default profile...
> no such file to load -- spec/expectations (LoadError)

try `gem install rspec`

Those examples were written pre-bundler. We could do with a Gemfile, either for the whole examples folder, or one per example.

> --
> You received this message because you are subscribed to the Google Groups "Cukes" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cukes+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cukes?hl=en.
>

cheers,
Matt

ma...@mattwynne.net
07974 430184

win

unread,
Feb 8, 2011, 10:22:07 PM2/8/11
to Cukes
Thank you for your help, Matt. I tried your suggestion, Ibut still
get the same error.

C:\ruby\lib\19\lib\ruby\gems\1.9.1\gems\cucumber-0.9.0\examples
\watir>gem list rsp

*** LOCAL GEMS ***

rspec (2.5.0)
rspec-core (2.5.1)
rspec-expectations (2.5.0)
rspec-mocks (2.5.0)

C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/examples/watir/
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/examples/watir/
>cucumber .
.\features\search.feature
Using the default profile...
No such file or directory - ../features/search.feature (Errno::ENOENT)
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
feature_file
.rb:53:in `initialize'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
feature_file
.rb:53:in `open'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
feature_file
.rb:53:in `source'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
feature_file
.rb:35:in `parse'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/feat
ures_loader.rb:28:in `block in load'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/feat
ures_loader.rb:26:in `each'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/feat
ures_loader.rb:26:in `load'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime/feat
ures_loader.rb:14:in `features'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime.rb:1
79:in `features'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/
runtime.rb:3
2:in `run!'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/cli/
main.rb:
54:in `execute!'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/lib/cucumber/cli/
main.rb:
29:in `execute'
C:/ruby186/lib/ruby/gems/1.9.1/gems/cucumber-0.9.0/bin/cucumber:8:in
`<top (
required)>'
C:/ruby186/bin/cucumber:19:in `load'
C:/ruby186/bin/cucumber:19:in `<main>'


Do you have any clue why? Is there a particular version of rspec that
I should install?

Regards,
Winata

On Feb 8, 2:16 am, Matt Wynne <m...@mattwynne.net> wrote:
> On 8 Feb 2011, at 05:56, win wrote:
>
>
>
>
>
> > I'm new in ruby/watir and I am trying to learn cucumber here.
> > Following the instructions fromhttp://wiki.openqa.org/display/WTR/Install+Ruby,
> > I installed Ruby 1.9.1 p430 and watir 1.7.1. sucessfully. Then I
> > installed cucumber 0.9.0. Using this version, I am able to run the
> > command "cucumber --help".
>
> > The next thing I am trying to do is to run cucumber examples.
> > According tohttps://github.com/aslakhellesoy/cucumber/wiki/
> m...@mattwynne.net
> 07974 430184- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Matt Wynne

unread,
Feb 9, 2011, 1:38:49 PM2/9/11
to cu...@googlegroups.com

On 9 Feb 2011, at 03:22, win wrote:

> Thank you for your help, Matt. I tried your suggestion, Ibut still
> get the same error.

Try Rspec 1.x

win

unread,
Feb 10, 2011, 12:19:02 PM2/10/11
to Cukes
Thanks, Matt! It works now.

gillescv

unread,
Jan 24, 2013, 12:28:43 PM1/24/13
to cu...@googlegroups.com
For information, I also use cucumber and rspec in my project.
The 21th of january 2013 I detected the same kind of error:
[WARNING] no such file to load -- spec/expectations (LoadError)
[WARNING] org/jruby/RubyKernel.java:1038:in `require'
[WARNING]
file:/C:/.m2/repository/.../jruby-complete-1.6.4.jar!/.../custom_require.rb:29:in
`require'
...
[WARNING] org/jruby/RubyKernel.java:1063:in `load'
[WARNING] -e:1:in `(root)'
mojoFailed de.saumya.mojo:cucumber-maven-plugin:0.28.5(run cucumber tests)

I identified that this was due to change of version of diff-lcs (on which rspec
depends).
Here is the combination of gems that make by build failed:
[INFO] --- jruby-rake-plugin:1.6.4:install-gems (install gems in jruby) @
jrubyhome ---
...
[INFO] Successfully installed diff-lcs-1.2.0
[INFO] Successfully installed cucumber-1.2.1
[INFO] Successfully installed rspec-core-2.12.2
[INFO] Successfully installed diff-lcs-1.1.3
[INFO] Successfully installed rspec-expectations-2.12.1
[INFO] Successfully installed rspec-mocks-2.12.1
[INFO] Successfully installed rspec-2.12.0
...

Here a combination of gems that works (by forcing version of diff-lcs to 1.1.3
(the previous one):
[INFO] --- jruby-rake-plugin:1.6.4:install-gems (install gems in jruby) @
jrubyhome ---
...
[INFO] Successfully installed diff-lcs-1.1.3
[INFO] Successfully installed cucumber-1.2.1
[INFO] Successfully installed rspec-core-2.12.2
[INFO] Successfully installed rspec-expectations-2.12.1
[INFO] Successfully installed rspec-mocks-2.12.1
[INFO] Successfully installed rspec-2.12.0
...

command line for forcing a version: gem install diff-lcs -v 1.1.3:

Regards
Gilles



Aslak Hellesøy

unread,
Jan 24, 2013, 1:09:44 PM1/24/13
to cu...@googlegroups.com

On Thursday, 24 January 2013 at 17:28, gillescv wrote:

For information, I also use cucumber and rspec in my project.
The 21th of january 2013 I detected the same kind of error:
[WARNING] no such file to load -- spec/expectations (LoadError)

What is requiring spec/expectations? This is a several years old RSpec API that is now in rspec/expectations. 

Aslak
--
-- Rules --

1) Please prefix the subject with [Ruby], [JVM] or [JS].
3) If you have a question, don't reply to an existing message. Start a new topic instead.

You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en

Reply all
Reply to author
Forward
0 new messages