Rspe no method error in spec_helper.rb

211 views
Skip to first unread message

arit...@gmail.com

unread,
Apr 20, 2015, 8:15:01 PM4/20/15
to rs...@googlegroups.com
Hello Iam trying to run a simple ruby test using Rspec and  Bundler. When I run $bundle exec rspec example_spec.rb  from the command line I get  a no method error pointing me towards my spec_helper.rb file. I  have both Rspec version 2.99 and 3.2.3 installed  although the computer is telling me it is using version 2.99. How can I get my system to use version 3.2.3 instead . pasted  error message Iam encountering. Thank you so much.


          Aris-MacBook-Pro:test-first-ruby ariticas$ bundle exec rspec 00_hello_spec.rb 

/Users/ariticas/test-first-ruby/spec/spec_helper.rb:31:in `block (2 levels) in <top (required)>': undefined method `include_chain_clauses_in_custom_matcher_descriptions=' for #<RSpec::Expectations::Configuration:0x007f8afa85f548> (NoMethodError)

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:580:in `expect_with'

from /Users/ariticas/test-first-ruby/spec/spec_helper.rb:23:in `block in <top (required)>'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core.rb:154:in `configure'

from /Users/ariticas/test-first-ruby/spec/spec_helper.rb:19:in `<top (required)>'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `require'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `block in setup_load_path_and_require'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `each'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration.rb:1036:in `setup_load_path_and_require'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/configuration_options.rb:25:in `configure'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/command_line.rb:17:in `run'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:103:in `run'

from /Library/Ruby/Gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec/core/runner.rb:17:in `block in autorun'

Jon Rowe

unread,
Apr 20, 2015, 8:50:40 PM4/20/15
to rs...@googlegroups.com
Make sure your gem file specifies `gem ‘rspec’, ‘~> 3.2.0’` and then run bundle update. This will make sure your bundle is running the latest version of RSpec.

Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/883ef5b6-f4ec-4a6a-88c3-a37f3cef7004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

arit...@gmail.com

unread,
Apr 20, 2015, 9:10:54 PM4/20/15
to rs...@googlegroups.com
This is what I have inside my gemfile 

gem "rspec", '~> 3.2.3'

yet I continue to have the same problem. 

arit...@gmail.com

unread,
Apr 20, 2015, 9:15:27 PM4/20/15
to rs...@googlegroups.com
this is what i see when i run `bundle update` 

Installing rspec-core 2.99.2 (was 2.99.1)

Installing rspec-expectations 2.99.2 (was 2.99.1)

Installing rspec-mocks 2.99.3 (was 2.99.1)

Using rspec 2.99.0

Using bundler 1.9.4 


On Monday, April 20, 2015 at 5:15:01 PM UTC-7, arit...@gmail.com wrote:

Antonio Antillon

unread,
Apr 20, 2015, 9:20:19 PM4/20/15
to rs...@googlegroups.com
try running

$ bundle update rspec

that should update the rspec version in your bundled gems.

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.

Jon Rowe

unread,
Apr 20, 2015, 9:42:05 PM4/20/15
to rs...@googlegroups.com
Sounds like you have a dependency that requires an older version of RSpec… (e.g. a lower pinned version of rspec-rails or a gem that expands rspec)

Jon Rowe
---------------------------

arit...@gmail.com

unread,
Apr 20, 2015, 9:52:18 PM4/20/15
to rs...@googlegroups.com
I ran bundle update respect and it still shows that it using spec 2.99. 

after I ran the update I ran the code again and I received the same error message. Is there something I should edit in my spec helper file perhaps.


On Monday, April 20, 2015 at 5:15:01 PM UTC-7, arit...@gmail.com wrote:

Jon Rowe

unread,
Apr 20, 2015, 10:03:22 PM4/20/15
to rs...@googlegroups.com
Like I said, you have something holding back the dependency on rspec, can you upload your Gemfile and Gemfile.lock?

Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.

arit...@gmail.com

unread,
Apr 20, 2015, 10:20:13 PM4/20/15
to rs...@googlegroups.com
here is my Gemfile:

gem ‘rspec’, '~> 3.2.3'

and here is a copy of my Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    diff-lcs (1.2.5)
    rspec (2.99.0)
      rspec-core (~> 2.99.0)
      rspec-expectations (~> 2.99.0)
      rspec-mocks (~> 2.99.0)
    rspec-core (2.99.1)
    rspec-expectations (2.99.1)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.99.1)

PLATFORMS
  ruby

DEPENDENCIES
  rspec (~> 2.0)

On Monday, April 20, 2015 at 5:15:01 PM UTC-7, arit...@gmail.com wrote:

arit...@gmail.com

unread,
Apr 20, 2015, 10:21:42 PM4/20/15
to rs...@googlegroups.com
just to so im clear both the gemfile and gemfile.lock should be in the projects root directory correct? as opposed to as in the directory where the specification is located ? 


On Monday, April 20, 2015 at 5:15:01 PM UTC-7, arit...@gmail.com wrote:

Jon Rowe

unread,
Apr 20, 2015, 11:23:53 PM4/20/15
to rs...@googlegroups.com
yes

Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.

arit...@gmail.com

unread,
Apr 21, 2015, 12:34:47 AM4/21/15
to rs...@googlegroups.com
ok thank you. would you happen to know  how I could run  an older version of Rspec to work with my dependency. Thank you 


On Monday, April 20, 2015 at 5:15:01 PM UTC-7, arit...@gmail.com wrote:

Jon Rowe

unread,
Apr 21, 2015, 12:50:01 AM4/21/15
to rs...@googlegroups.com
If you attach your Gemfile / .lock file we can help you upgrade your dependency

Jon Rowe
---------------------------

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.

arit...@gmail.com

unread,
Apr 21, 2015, 5:28:11 PM4/21/15
to rs...@googlegroups.com
here is my Gemfile:

gem ‘rspec’, '~> 3.2.3'

and here is a copy of my Gemfile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    diff-lcs (1.2.5)
    rspec (2.99.0)
      rspec-core (~> 2.99.0)
      rspec-expectations (~> 2.99.0)
      rspec-mocks (~> 2.99.0)
    rspec-core (2.99.1)
    rspec-expectations (2.99.1)
      diff-lcs (>= 1.1.3, < 2.0)
    rspec-mocks (2.99.1)

PLATFORMS
  ruby

DEPENDENCIES
  rspec (~> 2.0)

Jon Rowe

unread,
Apr 21, 2015, 7:36:10 PM4/21/15
to rs...@googlegroups.com
There’s clearly something wrong there as your Gemfile.lock doesn’t align with your Gemfile. Delete the .lock file and run bundle install.

Jon Rowe
---------------------------

arit...@gmail.com

unread,
Apr 21, 2015, 7:39:33 PM4/21/15
to rs...@googlegroups.com
I have deleted  Gemfile.lock and run bundle install. Yet Iam still getting the same error message.  

Jon Rowe

unread,
Apr 21, 2015, 8:15:28 PM4/21/15
to rs...@googlegroups.com
Are you running bundle install from the directory in which the Gemfile with `gem ‘rspec’, ‘~> 3.2.3’` is? Because if so you should probably open an issue with the bundler team because that shouldn’t be possible.

Jon Rowe
---------------------------

arit...@gmail.com

unread,
Apr 21, 2015, 8:28:13 PM4/21/15
to rs...@googlegroups.com

yea iam running bundle install from the directory in which my Gemfile is located. I there anything else I could possibly do? 

Jon Rowe

unread,
Apr 21, 2015, 8:42:49 PM4/21/15
to rs...@googlegroups.com
Talk to the bundler team, because a gemfile with what you pasted in should not result in that gemfile.lock, either you’re not pasting your entire file or something is wrong with your bundle

Jon Rowe
---------------------------

Myron Marston

unread,
Apr 21, 2015, 9:20:45 PM4/21/15
to rs...@googlegroups.com
As Jon said, the bundler team is probably going to be the best source of information about this.  Still, if you're able to push a repro case to github and point us at it, I'll be glad to try out your repo locally to see if I can reproduce and advise.

Myron

Reply all
Reply to author
Forward
0 new messages