grodowski / undercover

undercover warns about methods, classes and blocks that were changed without tests, to help you easily find untested code and reduce the number of bugs. It does so by analysing data from git diffs, code structure and SimpleCov coverage reports

Home Page:https://undercover-ci.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trouble getting started

aaronkelton opened this issue · comments

I followed the Installation and Setting up required LCOV reporting steps, but I cannot run undercover. Terminal gives back "command not found: undercover"

After running bundle exec rspec, I see that coverage/lcov/*.lcov was generated successfully.

Have you seen this issue before?

Hi!

It seems like the gem executable file is not accessible from system PATH. It kind of depends on your local setup.

If you have added undercover to Gemfile, please try running bundle exec undercover. You can try to install the gem globally with gem install undercover.

Let me know how this goes. Please include some details of your installation of ruby and this gem in case of no success

I tried both gem install undercover and running with bundle exec undercover, I get the following error and trace:

bundler: failed to load command: undercover (/Users/aaron/.rbenv/versions/2.5.1/bin/undercover)
Errno::ENOENT: No such file or directory @ rb_sysopen - ./config/initializers/cloudfront
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/imagen-0.1.4/lib/imagen/ast/parser.rb:10:in `read'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/imagen-0.1.4/lib/imagen/ast/parser.rb:10:in `parse_file'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/imagen-0.1.4/lib/imagen/node.rb:71:in `build_from_file'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/lib/undercover.rb:85:in `block in each_result_arg'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/lib/undercover.rb:83:in `each'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/lib/undercover.rb:83:in `each_result_arg'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/lib/undercover.rb:39:in `build'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/lib/undercover/cli.rb:21:in `run'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/bin/undercover:11:in `block in <top (required)>'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/2.5.0/benchmark.rb:308:in `realtime'
  /Users/aaron/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/undercover-0.1.7/bin/undercover:10:in `<top (required)>'
  /Users/aaron/.rbenv/versions/2.5.1/bin/undercover:23:in `load'
  /Users/aaron/.rbenv/versions/2.5.1/bin/undercover:23:in `<top (required)>'

From this error you can tell I'm using rbenv, Ruby 2.5.1, and I should note I'm also using Rails 4.2.8. I was originally on Ruby 2.4.3 but got a lot of deprecation warnings until I bumped up to 2.5.1; not sure if that had anything to do with this issue. I hope this helps!

Thanks for the details @chemturion. I verified that I can install undercover successfully in a rails 4.2.8 Gemfile, so it must be something specific to your app environment.

  1. I would try to run rbenv rehash to refresh shims for executable files (doc)
  2. No such file or directory @ rb_sysopen - ./config/initializers/cloudfront looks suspicious in that stacktrace, but it might be unrelated as well

No luck so far. I'm going to table this for now. Thank you for your efforts in the meantime!