simplecov-ruby / simplecov

Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites
MIT License
4.78k stars 553 forks source link

LoadError: cannot load such file -- simplecov #464

Closed jonbcampos closed 8 years ago

jonbcampos commented 8 years ago

I had simplecov running for a while and then one day I had to downgrade my ruby version and since then I can't get it working no matter what I do.

Now I am running: ruby 2.2.3p173 rails 4.2.4 simplecov 0.11.2 simplecov-html 0.10.0

I've tried uninstalling/reinstalling. I do make sure that the require/start block is at the top of my test_helper.rb but every time it hits the require line I get the error "LoadError: cannot load such file -- simplecov"

Any help would be greatly appreciated!

josephks commented 8 years ago

Gemsets are unique to a Ruby version. You need to gem install simplecov in the new Ruby.

jonbcampos commented 8 years ago

Good point. Sadly I already did that as I know I have to include new gem's per ruby installation. Currently a 'gem list' returns

...

simplecov (0.11.2)

simplecov-html (1.4.7)

...

Any other thoughts?

On Feb 16, 2016 12:59 AM, "Joseph Shraibman" notifications@github.com wrote:

Gemsets are unique to a Ruby version. You need to gem install simplecov in the new Ruby.

— Reply to this email directly or view it on GitHub https://github.com/colszowka/simplecov/issues/464#issuecomment-184551885 .

jonbcampos commented 8 years ago

I've done a clean uninstall/install of ruby using rvm. Still no go. I pulled simplecov out of the :test group and it started working. Any thoughts as to why and what the ramifications could be? How do I get it back in the test group?

BandanaPandey commented 8 years ago

@jonbcampos , if you have already done :: gem install simplecov in your Gemfile after downgrading your ruby version. Did you include (gem 'simplecov', :require => false) in your Gemfile :test group? If you haven't try this. Refer this one for the time being. Also can we please provide us more information about what is there in your spec_helper.rb.

jonbcampos commented 8 years ago

I found the issue. When the gem was in test it would be ignored because of my .bundle/config file. At some point it thought that it only needed to run production/develop gems, not test. So once I removed the BUNDLE_WITHOUT everything started to work as anticipated. Thank you for the follow up!

coderbhairishav commented 5 years ago

Just in case anyone still faces this issue. I recommend a simple hack just remove the coverage folder from root directory of the project and then run the test. As none of the above solution worked for me!

calebhaye commented 3 years ago

Also, be sure to use bundle exec rpsec when appropriate