Can't start rspec anymore

I had ruby ​​2.0 with rspec 3.0. I removed all rspec 3.0 gems and replaced them with 2.0. I did this to get rid of obsolescence warnings. Now my specifications do not work. I get the error below. What says the error and how can I fix it? None of the posts in this was helpful.

/zombie/spec/spec_helper.rb:29:in `block (2 levels) in <top (required)>': undefined method `include_chain_clauses_in_custom_matcher_descriptions=' for #<RSpec::Matchers::Configuration:0x00000001a73928> (NoMethodError)
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:398:in `expect_with'
    from /home/lsusr/Code/Rspec/zombie/spec/spec_helper.rb:21:in `block in <top (required)>'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core.rb:92:in `configure'
    from /home/lsusr/Code/Rspec/zombie/spec/spec_helper.rb:17:in `<top (required)>'
    from /home/lsusr/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/lsusr/.rvm/rubies/ruby-2.0.0-p598/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `block in requires='
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `map'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:434:in `requires='
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:20:in `block in configure'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `each'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/configuration_options.rb:19:in `configure'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:21:in `run'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
    from /home/lsusr/.rvm/gems/ruby-2.0.0-p598/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'

Ok, I found a fix.

I just removed all the unnecessary gems using

for i in `gem list --no-versions`; do gem uninstall -aIx $i; done

Then I just reinstalled rspec with the help gem install rspecthat rspec 3.0 gave me and fixed all the problems. But again, I receive warnings of failure.

Please tell me why the error occurred. The textbook author said that it should work with rspec 2.10.0 or higher.

+4
1

, rspec 2.10.0 .

, 2.10 , 2.x. RSpec 3.x .

, , :

gem install rspec '>=2.10', '<3'

.

, RSpec 3, ; , RSpec, , . , . 2.x 3.x.

, RSpec 2.0, , , , 2.0. , , 2.10 .

, , / , .

, RSpec , Semantic Versioning.

+1

Source: https://habr.com/ru/post/1569669/


All Articles