読者です 読者をやめる 読者になる 読者になる

Atom linter-rubocop でのエラー

linter-rubocop 0.5.0

Error: /Users/uraway/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:270:in `find_spec_for_exe': can't find gem rubocop (>= 0.a) (Gem::GemNotFoundException)
    from /Users/uraway/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:298:in `activate_bin_path'
    from /Users/uraway/.rvm/gems/ruby-2.3.1/bin/rubocop:22:in `<main>'
    from /Users/uraway/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
    from /Users/uraway/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'
    at /Users/uraway/.atom/packages/linter-rubocop/lib/index.coffee:57:15
    at process._tickCallback (internal/process/next_tick.js:103:7)

linter-rubocopが参照しているrubocopの場所がどうもおかしい。

とりあえずlinter-rubocopのドキュメントを見ると、解決法が:

rubocopのパスを調べて

which rubocop
/Users/uraway/.rvm/gems/ruby-2.3.1/bin/rubocop

bin/wrappers/に置き変えて、linter-rubocopのexecutablePathにペースト:

/Users/uraway/.rvm/gems/ruby-2.3.1/wrappers/rubocop

エラーはでなくなった。