Rspec Error 'Report_Activate_Error': Could Not Find Rubygem Rspec-Core (>=0) (Gem:Loaderror)

`report_activate_error': Could not find RubyGem bundler (= 0) (Gem::LoadError)

Please install 'bundler' Gem. Do

gem install bundler

and then run

bundle install

To run rake commands, use bundle exec

bundle exec rake command

Rake Aborted! Gem::LoadError: Could not find rspec 'x' but did find 'y'

That tutorial has a Gemfile that specifies that it needs rspec ">= 2.0" which probably excludes rspec 3. To install the proper versions of all needed gems, try these commands in the same folder as the Gemfile:

gem install bundler
bundle

EDIT: Actually, I think that tutorial's Gemfile is broken and didn't properly specify what version of rspec they wanted to use. They should have something like "~> 2.0" instead of ">= 2.0" I think. Try uninstalling rspec with gem uninstall rspec and then do gem install rspec -v 2.14.1. You could open a github issue asking them to update the tutorial to account for the new RSpec 3.x, which is not compatible with 2.x.

`to_specs': Could not find 'railties' (= 0) among 8 total gem(s) (Gem::LoadError)

The solution that worked for me is updating my OS X certs with brew (https://github.com/rubygems/rubygems/issues/1736) :

brew update
brew install openssl
brew tap raggi/ale
brew install openssl-osx-ca

Then updating my ruby version by rbenv install 2.4.0

rbenv local 2.4.0

gem install bundler
gem update --system

And it work :)

mysql2 gem in gem list but getting project can not find gem

Delete your Gemfile.lock and run bundle install

Runnin rspec from IntelliJ

You are pointing out that you are in ruby 2.2.6 when using the console. IntelliJ is complaining about missing the nokogiri gem.

I can imagine that probably your last bundle install did not use ruby 2.2.4 (as used by IntelliJ) but ruby 2.2.6 to install the gems.

I recommend the following steps to narrow this down:

  • verify and ensure that you are using ruby 2.2.4 on the shell (this is very important!)
  • run bundle install to ensure all gems of your project are installed for ruby 2.2.4
  • run your specs in the shell

If this succeeds then try running specs with IntelliJ.
This should work in case the steps described above went fine.

A personal note (not knowing if it's already the case):
In my projects I always have a .ruby-version file in the root of my project to ensure the correct ruby version for the current project. You may even go a step further and add a .ruby-gemset file.

More information can be found in the rvm docs



Related Topics



Leave a reply



Submit