Problems with latest version of RSpec: uninitialized constant ActiveRecord

After doing a bundle update today I have hit a problem that I think is
based in RSpec and I have not been able to solve. I can’t find any
information on this via Google, Stackoverflow or other RSpec discussions
so I thought I would post it here and see if it was either an obvious
problem or a helpful bug.

Every time I run:

cucumber features

I get the following errors:

Using the default profile…
uninitialized constant ActiveRecord (NameError)
/Library/Ruby/Gems/1.8/gems/rspec-expectations-2.5.0/lib/rspec/expectations/backward_compatibility.rb:6:in
const_missing' /Library/Ruby/Gems/1.8/gems/default_value_for-1.0.1/lib/rails.rb:23 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require’
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' /Library/Ruby/Gems/1.8/gems/cucumber-rails-0.4.1/lib/cucumber/rails.rb:1 /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:ingem_original_require’
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in require' /Users/petenixey/Rails_apps/kind-advice/features/support/env.rb:7 /Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/rb_support/rb_language.rb:143:inload’
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/…/lib/cucumber/rb_support/rb_language.rb:143:in
load_code_file' /Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:176:inload_file’
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/…/lib/cucumber/runtime/support_code.rb:78:in
load_files!' /Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime/support_code.rb:77:ineach’
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/…/lib/cucumber/runtime/support_code.rb:77:in
load_files!' /Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/runtime.rb:137:inload_step_definitions’
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/…/lib/cucumber/runtime.rb:39:in
run!' /Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/../lib/cucumber/cli/main.rb:43:inexecute!’
/Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/…/lib/cucumber/cli/main.rb:20:in
execute' /Library/Ruby/Gems/1.8/gems/cucumber-0.10.2/bin/cucumber:14 /usr/bin/cucumber:19:inload’
/usr/bin/cucumber:19

I’m sure there is a simple explanation but I’m lost as to how to solve
it. I’ve included both my gemfile and gemfile.lock for reference. Thank
you.

In case it’s of interest to anyone I finally managed to isolate what
was causing this problem.

By uninstalling and reinstalling all of my gems I narrowed the issue
down to a conflict between rspec-rails and the “default_value_for” gem.

The addition of the default_value_for gem means that “cucumber features”
fails with the errors above. It does not affect running “rspec spec”
which works fine.

I’m not sure which gem is triggering the problem or whether it’s the
cucumber gem but I’ve also flagged this to the authors of
default_value_for.

For a clean installation of Rails, the following gemfile thows errors:

source :rubygems

gem “rake”
gem “rails”, “>=3.0.7”

group :development, :test do

up to date

gem “faker”
gem “factory_girl_rails”
gem “ruby-debug19”
gem “capybara”, “>= 0.4.1.2”
gem ‘cucumber-rails’
gem ‘database_cleaner’
gem “rspec-rails”
gem “default_value_for”
end


(Apologies if this is the wrong place to post this but I wanted to
follow up on my earlier email)

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs