undefined method `configure' when running rake spec:rcov #236

kerryb opened this Issue Oct 11, 2010 · 8 comments

3 participants


After upgrading from 2.0.0.rc to 2.0.0, rake spec:rcov no longer works on my Rails 3 project. I see the following stack trace:

/Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/rspec-rails-2.0.0/lib/rspec/rails.rb:11: undefined method `configure' for RSpec:Module (NoMethodError)
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:227:in `load_dependency'
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
  from /Users/kerry/work/vdc/portico/spec/spec_helper.rb:4
  from ./spec/controllers/application_controller_spec.rb:1:in `require'
  from ./spec/controllers/application_controller_spec.rb:1
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/rcov-0.9.9/bin/rcov:516:in `load'
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/gems/rcov-0.9.9/bin/rcov:516
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/bin/rcov:19:in `load'
  from /Users/kerry/.rvm/gems/ruby-1.8.7-p302@portico/ruby/1.8/bin/rcov:19

Here is my Gemfile:

source "http://rubygems.org"

gem "rails", "3.0.0"

gem "crowd"
gem "formtastic"
gem "flutie"
gem "pg"

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
group :development, :test do
  gem "autotest"
  gem "autotest-growl"
  gem "capybara"
  gem "cucumber-rails", "0.3.2"
  gem "database_cleaner"
  gem "factory_girl_rails"
  gem "factory_girl_generator"
  gem "launchy"
  gem "rcov"
  gem "rspec-rails"
  gem "spork"
  gem "shoulda"
  gem "webmock", :require => nil
  gem "wirble"
RSpec member

require 'rspec/core' before using RSpec.configure

RSpec member

Until rspec-rails-2.0.1 is released, just add require 'rspec/core' before require 'rspec/rails' in spec/spec_helper.rb and you should be OK.


Thanks David, that works a treat.


I have this same problem, similar backtrace, not resolved by requiring rspec/core … any advice?

RSpec member

@leehambley - requiring rspec/core fixes it - you just need to do it in the right place. Where are you requiring rspec/core?


@dchelimsky I recognise now I had :require => 'rspec/rails' in my gemfile - which naturally wouldn't work until SHA:0115007 lands; my mistake for replying here before exhausting my options of search.

RSpec member

@leehambley - so you've got it working now?


@dchelimsky yes thank you, maybe something you could clear up in the docs about using rspec/rails with bundler, not to do the require in there, rather in your spec_helper. I have no only a problem with not finding which file to include to get the Rake tasks, but that's a whole other issue!

Thanks for the responses on here.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment