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

cannot load such file -- capybara/minitest (LoadError) #30952

Closed
mockdeep opened this issue Oct 23, 2017 · 4 comments
Closed

cannot load such file -- capybara/minitest (LoadError) #30952

mockdeep opened this issue Oct 23, 2017 · 4 comments

Comments

@mockdeep
Copy link
Contributor

Steps to reproduce

We have Capybara locked at version 2.7.1 and see the error below when trying to require system tests. Will we be unable to load system tests until we can upgrade Capybara? Related to this issue on the rspec-rails gem.

/home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require': cannot load such file -- capybara/minitest (LoadError)
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/actionpack-5.1.4/lib/action_dispatch/system_test_case.rb:2:in `<top (required)>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/scratch/rspec-rails/lib/rspec/rails/example/system_example_group.rb:28:in `<top (required)>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/scratch/rspec-rails/lib/rspec/rails/example.rb:11:in `<top (required)>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/scratch/rspec-rails/lib/rspec/rails.rb:13:in `<top (required)>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
	from /home/fletch/Dropbox/projects/chalk/synchroform/spec/rails_helper.rb:35:in `<top (required)>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `require'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `block in requires='
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `each'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration.rb:1455:in `requires='
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:112:in `block in process_options_into'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:111:in `each'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:111:in `process_options_into'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/configuration_options.rb:21:in `configure'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:99:in `setup'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:86:in `run'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:71:in `run'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/lib/rspec/core/runner.rb:45:in `invoke'
	from /home/fletch/.rvm/gems/ruby-2.4.2/gems/rspec-core-3.7.0/exe/rspec:4:in `<top (required)>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/bin/rspec:23:in `load'
	from /home/fletch/.rvm/gems/ruby-2.4.2/bin/rspec:23:in `<main>'
	from /home/fletch/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `eval'
	from /home/fletch/.rvm/gems/ruby-2.4.2/bin/ruby_executable_hooks:15:in `<main>'

Expected behavior

Tests should run.

Actual behavior

An error is thrown.

System configuration

Rails version: 5.1.4

Ruby version: 2.4.2

@y-yagi
Copy link
Member

y-yagi commented Oct 23, 2017

Minitest style assertions(capybara/minitest) was supported in Capybara 2.13.0. Therefore, you need to upgrade to Capybara 2.13.0 or higher.
Ref: eadbc82

@lostapathy
Copy link
Contributor

Would there be merit in throwing an explicit exception about the minimum Capybara::VERSION ahead of this line instead of just letting it fall through like this, or is that something rails doesn't like to have in the code?

@rafaelfranca
Copy link
Member

Bundler and Rubygems already take care of this. The gemfile defines capybara ~> 2.13 already. Some applications may not have this requirement because they are upgrading, but in this case we could add gem capybara, ~> 2.13` on the top of this file. Mind to open a PR?

lostapathy added a commit to lostapathy/rails that referenced this issue Oct 23, 2017
Upgraded rails applications may have a Gemfile without a new enough
capybara to run system tests. Setting a version here gives the user a
more direct error message than they get otherwise.  Resolves rails#30952
@lostapathy
Copy link
Contributor

thanks @rafaelfranca I was aware we could specify gem versions like that in both Gemfile and gemspec, but did not realize we could do it in a normal ruby file as well. I put in a PR #30959

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

4 participants