我使用rubocop檢查程序使用flycheck模式。使用rubocop檢測Emacs flycheck模式的錯誤
當我打開一些RB文件,
Checker ruby-rubocop returned non-zero exit code 1, but no errors from output: /Users/abc/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:2157:in `method_missing': undefined method `this' for #<Gem::Specification:0x3fc38c8edb10 rubocop-0.35.1> (NoMethodError)
from /Users/abc/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1056:in `find_active_stub_by_path'
from /Users/abc/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:63:in `require'
from /Users/abc/.rvm/gems/ruby-2.2.3/gems/rubocop-0.35.1/bin/rubocop:6:in `<top (required)>'
from /Users/abc/.rvm/gems/ruby-2.2.3/bin/rubocop:23:in `load'
from /Users/abc/.rvm/gems/ruby-2.2.3/bin/rubocop:23:in `<main>'
from /Users/abc/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
from /Users/abc/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
Checker definition probably flawed.
而且flycheck模式是行不通的
我也用彈/炮彈護欄模式。但某些項目的rb文件不會引發錯誤。某些項目發生錯誤。
rubocop可以從命令行運行嗎?通常它發生的原因有兩種,1)rubocop.yml有一些問題2)你使用的是rvm,如果它是一個rubocop.yml問題,你將很容易通過從命令行運行rubocop來看到它,如果它是rvm,那麼你可能需要使用rvm(https://github.com/senny/rvm.el) – goromlagche