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

uninitialized constant RSpec::Core::Hooks #49

Closed
aldesantis opened this issue Dec 16, 2013 · 15 comments
Closed

uninitialized constant RSpec::Core::Hooks #49

aldesantis opened this issue Dec 16, 2013 · 15 comments
Labels
outdated Inactive - Outdated

Comments

@aldesantis
Copy link

Whenever I run Rake, I get this error:

rake aborted!
uninitialized constant RSpec::Core::Hooks
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@herudio/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:32:in `<class:Configuration>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@herudio/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:31:in `<module:Core>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@herudio/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:7:in `<module:RSpec>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@herudio/gems/rspec-core-2.14.7/lib/rspec/core/configuration.rb:6:in `<top (required)>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@herudio/gems/fuubar-1.3.0/lib/fuubar.rb:1:in `<top (required)>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
/home/alessandro/projects/herudio/config/application.rb:7:in `<top (required)>'
/home/alessandro/projects/herudio/Rakefile:4:in `require'
/home/alessandro/projects/herudio/Rakefile:4:in `<top (required)>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `block in load_rakefile'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:77:in `block in run'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/gems/rake-10.1.0/bin/rake:33:in `<top (required)>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/bin/rake:23:in `load'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/bin/rake:23:in `<main>'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/bin/ruby_executable_hooks:15:in `eval'
/home/alessandro/.rvm/gems/ruby-2.0.0-p353@global/bin/ruby_executable_hooks:15:in `<main>'

Here's my Gemfile:

source 'https://rubygems.org'
ruby '2.0.0'

# Rails
gem 'rails', '4.0.2'

# Users
gem 'cancan'
gem 'devise'
gem 'rolify'

gem 'figaro'

# Assets preprocessors
gem 'sass-rails', '~> 4.0.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'

# Assets libs
gem 'jquery-rails'
gem 'turbolinks'
gem 'foundation-rails'

# Templating
gem 'haml-rails'

# Active Record
gem 'pg'

# Forms
gem 'simple_form'

# JS runtime
gem 'therubyracer', platform: :ruby

# Web server
gem 'thin'

# I18n
gem 'rails-i18n'
gem 'devise-i18n'

group :development do
  # Error management
  gem 'better_errors'
  gem 'binding_of_caller', platforms: [:mri_19, :mri_20, :rbx]

  # Templating
  gem 'html2haml'

  # Disable assets logging
  gem 'quiet_assets'
end

group :development, :test do
  # RSpec
  gem 'rspec-rails'
  gem 'fuubar'

  # Factories
  gem 'factory_girl_rails'
end

group :test do
  # Integration tests
  gem 'capybara'

  # Database testing
  gem 'database_cleaner', '1.0.1'

  # Email testing
  gem 'email_spec'
end

rake's version: 10.1.0
rspec-core's version: 2.14.7
fuubar's version: 1.3.0

@jfelchner
Copy link
Collaborator

@alessandro1997 if you bundle open fuubar and remove the top require line for configuration, does that seem to make it work?

@aldesantis
Copy link
Author

Nope, I get undefined method configuration' for RSpec:Module`.

@aldesantis
Copy link
Author

The issue seems to affect version 1.3.0 only. If I lock the gem to 1.2.1, everything works fine.

@jfelchner
Copy link
Collaborator

@alessandro1997 right, that's because it's a bug introduced in the latest version. 😄

@jfelchner
Copy link
Collaborator

Just pushed v1.3.1. Unlock from 1.2.1, do a

bundle update fuubar

and let me know if that works.

@aldesantis
Copy link
Author

I still get undefined method configuration' for RSpec:Module`.

@jfelchner
Copy link
Collaborator

@alessandro1997 one more thing. Try adding gem 'rspec' to your Gemfile before the rspec-rails line.

@aldesantis
Copy link
Author

Now it's working! Shouldn't it be included automatically since it's a dependency?

@jfelchner
Copy link
Collaborator

Excellent!

Can you please do me one more favor and see if this works?

bundle open fuubar

Make sure that the require lines look like this:

require 'rspec'
require 'rspec/core/formatters/base_text_formatter'
require 'ruby-progressbar'

And then remove the:

gem 'rspec'

from your Gemfile.

@jfelchner
Copy link
Collaborator

If that doesn't work, try removing:

require 'rspec/core/formatters/base_text_formatter'

and try again.

@aldesantis
Copy link
Author

It works even without removing:

require 'rspec/core/formatters/base_text_formatter'

@jfelchner
Copy link
Collaborator

@alessandro1997 thank you!

@aldesantis
Copy link
Author

No, thank you for this little awesome gem!

@jfelchner
Copy link
Collaborator

be05ff8 fixes this issue and version 1.3.2 has been released.

Versions 1.3.0 and 1.3.1 which included this bug have been yanked.

@github-actions
Copy link

This issue has been closed automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the outdated Inactive - Outdated label Dec 28, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated Inactive - Outdated
Development

No branches or pull requests

2 participants