Question

I tried to comment out the gem files and whenever I use rake, I get the following error:

(in /home/egervari/Projects/training)
rake aborted!
undefined method `basename' for "/usr/local/lib/ruby/gems/1.9.1/gems/actionmailer-3.0.7":String
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:601:in `block in latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:600:in `latest_partials'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:587:in `block in latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `each'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems.rb:586:in `latest_load_paths'
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/deprecate.rb:62:in `block (2 levels) in deprecate'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:112:in `other_spork_gem_load_paths'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork.rb:105:in `detect_and_require'
/usr/local/lib/ruby/gems/1.9.1/gems/spork-0.8.4/lib/spork/test_framework.rb:167:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey/spork/test_framework/rspec.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/monkey.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.5.2/lib/rspec/core.rb:65:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `block in require'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:239:in `require'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec/rails/tasks/rspec.rake:1:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `block in load'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `block in load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:596:in `new_constants_in'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:225:in `load_dependency'
/usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/active_support/dependencies.rb:235:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.5.0/lib/rspec-rails.rb:10:in `block in <class:Railtie>'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `call'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/railtie.rb:184:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `block in load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `each'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application/railties.rb:11:in `all'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:140:in `load_tasks'
/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/home/egervari/Projects/training/Rakefile:7:in `<top (required)>'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2017:in `block in load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2000:in `block in run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/usr/local/lib/ruby/gems/1.9.1/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19:in `<main>'

In addition to the above problem... besides doing a text-search for all the places in my rails app that uses cucumber, is there any special gotchas?

Was it helpful?

Solution

It would appear that I have fixed the problem on my own (and it would have been infinitely hard for anyone to fix blindly me thinks).

For some reason, removing Cucumber caused Spork to cause this error. I do not understand why, but Spork used to work fine... and now it doesn't :/

The solution was to remove spork.

I think there is a bug in either Spork, or somewhere down the line. It has something to do with the paths. Someone else noticed that the code is calling basename on a string, but it should have used File.basename(the_string) instead.

I would imagine that this got fixed in newer versions, but it probably won't be patched for those of us using Rails 3.0.7

Anyhoo, if you're getting this problem, just remove Spork. I know it sucks, but Spork kind of over-promises and under-delivers anyway - at least for me :( In my experience of using it this week, it has caused more headaches and problems than the time it has saved me. So, it's time for Spork to go.

Anyway, I hope that helps others.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top