script/generate cucumber fails in Rails 2.3.5 and Ruby 1.9.1

120 views
Skip to first unread message

Rodrigo Dellacqua

unread,
Dec 30, 2009, 5:30:46 PM12/30/09
to rubyonra...@googlegroups.com
Hey there,

I need a quick help in here.

I have a full working rails environment.

I just installed cucumber.

sudo gem install cucumber cucumber-rails

on my app folder i tried, script/generate cucumber; this is the result.

/var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- cucumber/platform (MissingSourceFile)
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/cucumber-rails-0.2.2/generators/cucumber/cucumber_generator.rb:2:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/spec.rb:17:in `klass'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/lookup.rb:140:in `instance'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/scripts.rb:31:in `run'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/commands/generate.rb:6:in `<top (required)>'
    from script/generate:3:in `require'
    from script/generate:3:in `<main>'

This should be something easy that I missed.

Any thoughts?

[]'s
RD

Christoph Jasinski

unread,
Dec 30, 2009, 6:15:21 PM12/30/09
to rubyonra...@googlegroups.com
Have you added cucumber to your environment(s)?

From Railscasts.com (#155) as an example. Adjust as you need.

# config/environments/test.rb
config.gem "rspec", :lib => false, :version => ">=1.2.2"
config.gem "rspec-rails", :lib => false, :version => ">=1.2.2"
config.gem "webrat", :lib => false, :version => ">=0.4.3"
config.gem "cucumber", :lib => false, :version => ">=0.2.2"


Cheers,
Chris

Rodrigo Dellacqua

unread,
Dec 30, 2009, 6:31:42 PM12/30/09
to rubyonra...@googlegroups.com
Christoph

Yes, this is my currently configuration in the tests.rb

config.gem "rspec", lib => false, :version => ">=1.2.9"
config.gem "rspec-rails", lib => false, :version => ">=1.2.9"
config.gem "webrat", lib => false, :version => ">=0.6.0"
config.gem "cucumber", lib => false, :version => ">=0.5.3"

Since that episode is a bit older, and there's this new cucumber-rails, do I need to setup up a config.gem key for him as well?

Cordially,

Rodrigo Dellcqua
IBM - IGF Project Manager
"Communication is the key"

--

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

E. Litwin

unread,
Dec 30, 2009, 6:34:43 PM12/30/09
to Ruby on Rails: Talk
Christoph,

Running script/generate cucumber creates an environments/cucumber.rb
with those lines (and it is be "cucumber-rails" that is added now, not
"cucumber").

Eric

On Dec 30, 3:15 pm, Christoph Jasinski

Christoph Jasinski

unread,
Dec 30, 2009, 6:37:46 PM12/30/09
to rubyonra...@googlegroups.com
thanks eric,

that's what I saw before you mailed. It's so late and I'm coding for over 12 hours you know. Of course it cucumber-rails. Sorry just copied & pasted it => stupid_me.

Chris

Rodrigo Dellacqua

unread,
Dec 30, 2009, 7:22:12 PM12/30/09
to rubyonra...@googlegroups.com
Guys,

Dont lose focus. =)

The problem is that the script/generate cucumber doesn't work, it reports this error.

my config/environments/tests.rb looks like this now.

config.gem "rspec", lib => false, :version => ">=1.2.9"
config.gem "rspec-rails", lib => false, :version => ">=1.2.9"
config.gem "webrat", lib => false, :version => ">=0.6.0"
config.gem "cucumber", lib => false, :version => ">=0.5.3"
config.gem "cucumber-rails", lib => false, :version => ">=0.2.2"

I'm still facing the problem.


/var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- cucumber/platform (MissingSourceFile)
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/cucumber-rails-0.2.2/generators/cucumber/cucumber_generator.rb:2:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/spec.rb:17:in `klass'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/lookup.rb:140:in `instance'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/scripts.rb:31:in `run'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/commands/generate.rb:6:in `<top (required)>'
    from script/generate:3:in `require'
    from script/generate:3:in `<main>'


[]'s
Rodrigo Dellacqua

Chris

--

Christoph Jasinski

unread,
Dec 30, 2009, 7:27:16 PM12/30/09
to rubyonra...@googlegroups.com
Try to reinstall cucumber and cucumber-rails. How does your environments/cucumber.rb looks like? Can you post it. I have no futher tips. Sorry.

Cheers,
Chris

Rodrigo Dellacqua

unread,
Dec 30, 2009, 7:33:09 PM12/30/09
to rubyonra...@googlegroups.com
Chris,

There's no environments/cucumber.rb file.

I thought it would be generated by using the script/generate cucumber.

I'm following a screencast by Ryan Bates, which currently doesn't work anymore :)

Kinda lost here.


/var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require': no such file to load -- cucumber/platform (MissingSourceFile)
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/cucumber-rails-0.2.2/generators/cucumber/cucumber_generator.rb:2:in `<top (required)>'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `block in require'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in'
    from /var/lib/gems/1.9.1/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in `require'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/spec.rb:17:in `klass'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/lookup.rb:140:in `instance'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/rails_generator/scripts.rb:31:in `run'
    from /var/lib/gems/1.9.1/gems/rails-2.3.5/lib/commands/generate.rb:6:in `<top (required)>'
    from script/generate:3:in `require'
    from script/generate:3:in `<main>'

Looking at the error, it seems like its missing something from a rails activesupport.

Does cucumber works with Ruby 1.9.1 and rails 2.3.5?

[]'s
Rodrigo Dellacqua


Chris

--

Christoph Jasinski

unread,
Dec 30, 2009, 8:06:20 PM12/30/09
to rubyonra...@googlegroups.com
Seems to me that we found the error. You cucumer.rb is missing. Send you mine I it help somehow:


# Edit at your own peril - it's recommended to regenerate this file
# in the future when you upgrade to a newer version of Cucumber.

# IMPORTANT: Setting config.cache_classes to false is known to
# break Cucumber's use_transactional_fixtures method.
# For more information see https://rspec.lighthouseapp.com/projects/16211/tickets/165
config.cache_classes = true

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.action_controller.consider_all_requests_local = true
config.action_controller.perform_caching             = false

# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection    = false

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test

config.gem 'cucumber-rails',   :lib => false, :version => '>=0.2.2' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber-rails'))
config.gem 'database_cleaner', :lib => false, :version => '>=0.2.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/database_cleaner'))
config.gem 'webrat',           :lib => false, :version => '>=0.6.0' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat'))
config.gem 'rspec',            :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec'))
config.gem 'rspec-rails',      :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))


Cheers,
Chris

Rodrigo Dellacqua

unread,
Dec 30, 2009, 8:48:17 PM12/30/09
to rubyonra...@googlegroups.com
Guys,

Still nothing :(

Same error after creating the cucumber.rb file in the environments.

script/generate cucumber still not working.

Thx Chris!

Any one else?

[]'s
RD




Cheers,
Chris

--

Christoph Jasinski

unread,
Dec 30, 2009, 10:01:49 PM12/30/09
to rubyonra...@googlegroups.com
Last thing.
start an empty project and see whether you get an error too. Ex:

-> rails tmp
-> cd tmp
-> ruby script/generate rspec
-> ruby script/generate cucumber (look whether it creates all the files)

if not something's wrong with the gem maybe or ....???

Chris

E. Litwin

unread,
Dec 31, 2009, 12:37:12 PM12/31/09
to Ruby on Rails: Talk
Rodrigo,

In my initial reply, I was trying to say to Christoph (obviously not
very clearly) is that you don't have to manually create the
cucumber.rb file. script/generate cucumber will do that for you.

Can you switch back to Ruby 1.8.7 (or 1.8.6) via RVM or some other
utility and determine if you can run script/generate cucumber without
issue?

Eric

On Dec 30, 7:01 pm, Christoph Jasinski

Rodrigo Dellacqua

unread,
Jan 3, 2010, 9:16:04 AM1/3/10
to rubyonra...@googlegroups.com
Chris/Eric,

Thanks both of you.

Well, what happens is that I was using RubyMine which promptly asks you, if you want to install gems that are missing or just install gems from their interface.

It ends up that RubyMine doesn't correctly install the gems. When I tried to list the available actions for script/generate it didn't show me the cucumber option.

I removed all cucumber related gems from my environment and them did the install through sudo gem install cucumber.

After that, all the necessary actions were available to the script/generate.

[]'s
Rodrigo Dellacqua

Reply all
Reply to author
Forward
0 new messages