Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kerryb opened this issue Oct 11, 2010 · 8 comments
Closed

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

kerryb opened this issue Oct 11, 2010 · 8 comments

Comments

@kerryb
Copy link

kerryb commented Oct 11, 2010

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"
end
@dchelimsky
Copy link
Contributor

require 'rspec/core' before using RSpec.configure

@dchelimsky
Copy link
Contributor

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.

@kerryb
Copy link
Author

kerryb commented Oct 11, 2010

Thanks David, that works a treat.

@leehambley
Copy link

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

@dchelimsky
Copy link
Contributor

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

@leehambley
Copy link

@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.

@dchelimsky
Copy link
Contributor

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

@leehambley
Copy link

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants