How do I add a method to ActiveRecord::Batches? - ruby

I was trying to add my custom implementation for ActiveRecordss find_in_batches method. First, I tried to monkeypatch the corresponding module:
module ActiveRecord
module Batches
def find_in_batches2
end
end
end
Task.find_in_batches2 do |group|
end
But ruby said:
NoMethodError: undefined method `find_in_batches2' for Task (call 'Task.connection' to establish a connection):Class
/home/yuri/.gem/ruby/2.1.5/gems/activerecord-4.2.0/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
/srv/http/tm/Rakefile:15:in `<top (required)>'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
/home/yuri/.gem/ruby/2.1.5/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
-e:1:in `<main>'
Then I tried following this answer, to no avail. What am I doing wrong and why is it so hard?

Here is the solution:
ActiveRecord::Batches.module_eval do
def find_in_batches2
end
end
ActiveRecord::Querying.module_eval do
delegate :find_in_batches2, :to => :all
end
Don't forget to implement find_in_batches2.

Related

NoMethodError: undefined method `validates_confirmation_of' Sinatra

Im getting the above error but dont understand why. Here is the stack trace:
/Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/app/models/user.rb:8:in `<class:User>': undefined method `validates_confirmation_of' for User:Class (NoMethodError)
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/app/models/user.rb:4:in `<top (required)>'
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/app/data_mapper_setup.rb:6:in `require_relative'
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/app/data_mapper_setup.rb:6:in `<top (required)>'
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/app/app.rb:4:in `require_relative'
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/app/app.rb:4:in `<top (required)>'
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/spec/spec_helper.rb:3:in `require'
from /Users/benrumble/Desktop/Apple_tv_movies_and_stuff/skeletons/Full_Stack_Sinatra_App_Skeleton/Skeleton_App_with_user_login:sign_up_and_bcrypt/spec/spec_helper.rb:3:in `<top (required)>'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1394:in `require'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1394:in `block in requires='
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1394:in `each'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration.rb:1394:in `requires='
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration_options.rb:111:in `each'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration_options.rb:111:in `process_options_into'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/configuration_options.rb:21:in `configure'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:99:in `setup'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:86:in `run'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:71:in `run'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/lib/rspec/core/runner.rb:45:in `invoke'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.5.0/exe/rspec:4:in `<top (required)>'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/bin/rspec:23:in `load'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/bin/rspec:23:in `<main>'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/benrumble/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
and here is the user.rb model
require 'bcrypt'
require 'dm-validations'
class User
attr_reader :password
attr_accessor :password_confirmation
validates_confirmation_of :password
include DataMapper::Resource
property :id, Serial
property :email, String
property :password_digest, String, length: 60
def password=(password)
#password = password
self.password_digest = BCrypt::Password.create(password)
end
end
I tried with and without 'dm-validations' but it doesnt make a difference.
Any help would be great.
Thanks
I solved this issue by moving the
include DataMapper::Resource
line as the first line after declaring the class.

Monkey patching Object leads to Pry deadlock

I'm trying to monkey patch Object and while my tests run fine,
I can't load my project with Pry anymore.
Here is the relevant code:
module CoreExtensions
def instance_values
instance_variables.each_with_object({}) do |var, hash|
hash[var[1..-1]] = instance_variable_get(var)
end
end
def ==(other)
(self.class == other.class) &&
(instance_values.equal? other.instance_values)
end
end
Object.include CoreExtensions
Using
pry -r ./core_extentions.rb
leads to this stacktrace:
Error: No live threads left. Deadlock?
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:87:in `sleep'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:87:in `wait'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:87:in `block in enter_interruptible_region'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:83:in `synchronize'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:83:in `enter_interruptible_region'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:110:in `interruptible_region'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:197:in `input_readline'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:190:in `block in read_line'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:129:in `handle_read_errors'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:170:in `read_line'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:98:in `read'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:68:in `block in repl'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `loop'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:67:in `repl'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `block in start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:61:in `__with_ownership'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/input_lock.rb:79:in `with_ownership'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:38:in `start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/repl.rb:15:in `start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/pry_class.rb:169:in `start'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-byebug-3.3.0/lib/pry-byebug/pry_ext.rb:11:in `start_with_pry_byebug'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:219:in `block in <top (required)>'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:83:in `block in parse_options'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:83:in `each'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/lib/pry/cli.rb:83:in `parse_options'
/home/fap/.rvm/gems/ruby-2.3.0/gems/pry-0.10.3/bin/pry:16:in `<top (required)>' /home/fap/.rvm/gems/ruby-2.3.0/bin/pry:23:in `load'
/home/fap/.rvm/gems/ruby-2.3.0/bin/pry:23:in main
/home/fap/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
/home/fap/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in main
The same thing happens when I include my CoreExtentions in the main class.
I read about Pry's input_lock, but I don't understand what produces the deadlock.
Does anyone have an idea why this is happening?
You have redefined method == for all objects, which is not a good thing.
This comes about from the last line in your question, namely Object.include CoreExtentions
Without that definition, it loads fine.

undefined method `before' for main:Object

I'm getting the above error from section of code below. What is the cause?
1 require 'spec_helper'
2
3 before(:all) do
4 puts "ServerSpec tests on #{ENV['TARGET_HOST']}"
5 end
Full error:
/home/newatson/src/serverspec/spec/cfengine3/common_spec.rb:3:in `<top (required)>': undefined method `before' for main:Object (NoMethodError)
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `load'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1226:in `block in load_spec_files'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `each'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/configuration.rb:1224:in `load_spec_files'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:97:in `setup'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:85:in `run'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:70:in `run'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/lib/rspec/core/runner.rb:38:in `invoke'
from /home/newatson/.gem/ruby/1.9.1/gems/rspec-core-3.2.3/exe/rspec:4:in `<top (required)>'
from /home/newatson/.gem/ruby/1.9.1/bin/rspec:19:in `load'
from /home/newatson/.gem/ruby/1.9.1/bin/rspec:19:in `<main>'
before should be implemented within describe:
require 'spec_helper'
describe "My Tests" do
before(:all) do
puts "ServerSpec tests on #{ENV['TARGET_HOST']}"
end
end
Good luck!
Seems like you missed to describe your class. Without describe Object becomes a receiver and you have a NoMethodError. Easy fix:
describe MyClass do
before(:all) do
#
end
end

Ruby: Rspec 2.14.1 on ruby 1.9.1 compatibility

Before anything, I know 1.9.1 (1.9.1-p243 specifically) is old and broken, but we have an app with a pretty strict dependency on it.
First off, is there a list of rspec-supported rubies?
Secondly, when putting anything in a describe block in a spec, I get an error uninitialized constant BasicObject::Class (NameError).
With this spec:
require_relative 'rspec_basic_object_test'
describe RspecBasicObjectTest do
before :each do
#obj = RspecBasicObjectTest.new
end
it 'returns something' do
#obj.foo.should == "foo"
end
end
and this ruby file:
class RspecBasicObjectTest
attr_reader :foo
def initialize
#foo = "foo"
end
end
I get:
dlampa#ubuntu:~/code/mine$ rspec rspec_basic_object_test_spec.rb
/home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/syntax.rb:74:in `block in enable_should': uninitialized constant BasicObject::Class (NameError)
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/syntax.rb:28:in `class_eval'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/syntax.rb:28:in `enable_should'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:34:in `syntax='
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:52:in `<module:Mocks>'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:2:in `<module:RSpec>'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/configuration.rb:1:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks/framework.rb:34:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-mocks-2.14.6/lib/rspec/mocks.rb:1:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/mocking/with_rspec.rb:1:in `<top (required)>'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/rubies/ruby-1.9.1-p243/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:388:in `mock_with'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:278:in `mock_framework'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:884:in `configure_mock_framework'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:280:in `ensure_example_groups_are_configured'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:295:in `set_it_up'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:245:in `subclass'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/example_group.rb:232:in `describe'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/dsl.rb:18:in `describe'
from /home/dlampa/code/mine/rspec_basic_object_test_spec.rb:3:in `<top (required)>'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `each'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/configuration.rb:896:in `load_spec_files'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/command_line.rb:22:in `run'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:80:in `run'
from /home/dlampa/.rvm/gems/ruby-1.9.1-p243#rspec-test/gems/rspec-core-2.14.8/lib/rspec/core/runner.rb:17:in `block in autorun'
Anyone else run into this? Or am I just missing something obvious in rspec's README that says 1.9.1 is old and broken, why are you using it?

uninitialized constant ActionDispatch (NameError) in Ruby

My Code in ruby class is. Here i am getting uninitialized constant ActionDispatch (NameError)
DatabaseCleaner.strategy = :transaction
class ActionDispatch::IntegrationTest
# Make the Capybara DSL available in all integration tests
include Capybara::DSL
# Stop ActiveRecord from wrapping tests in transactions
self.use_transactional_fixtures = false
teardown do
DatabaseCleaner.clean # Truncate the database
Capybara.reset_sessions! # Forget the (simulated) browser state
Capybara.use_default_driver
end
end
I ran into the same issue, after upgrading.
This is my stack trace:
uninitialized constant ActionDispatch::IntegrationTest (NameError)
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-rails-1.3.1/lib/cucumber/rails/world.rb:9:in `<module:Rails>'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-rails-1.3.1/lib/cucumber/rails/world.rb:8:in `<module:Cucumber>'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-rails-1.3.1/lib/cucumber/rails/world.rb:7:in `<top (required)>'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/backports-3.3.0/lib/backports/tools.rb:328:in `require'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/backports-3.3.0/lib/backports/tools.rb:328:in `require_with_backports'
/Users/etagwerker/Projects/om/features/support/env.rb:11:in `<top (required)>'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/rb_support/rb_language.rb:122:in `load'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/rb_support/rb_language.rb:122:in `load_code_file'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/runtime/support_code.rb:180:in `load_file'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/runtime/support_code.rb:82:in `each'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/runtime.rb:183:in `load_step_definitions'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/runtime.rb:42:in `run!'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/lib/cucumber/cli/main.rb:47:in `execute!'
/Users/etagwerker/.rvm/gems/ruby-1.9.3-p327#ombu/gems/cucumber-1.3.1/bin/cucumber:13:in `<top (required)>'
script/cucumber:9:in `load'
script/cucumber:9:in `<main>'
I am using rails 3.0.20 and cucumber-rails 1.3.1.
After trying a few things, I tried this:
rails generate cucumber:install
That solved it for me.

Resources