2017-04-18 65 views
2

我試圖在原子中連接rubocop並在原子中出錯。不要與原子一起使用rubocop

linter-registry.js [sm]:144 [Linter] Error running RuboCop Error: /usr/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'rubocop' (>= 0.a) among 16 total gem(s) (Gem::LoadError) 
Checked in 'GEM_PATH=/home/kurilovichay/.rvm/gems/ruby-2.3.1:/home/kurilovichay/.rvm/gems/[email protected]', execute `gem env` for more information 
    from /usr/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec' 
    from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem' 
    from /usr/local/bin/rubocop:22:in `<main>' 
    at parseFromStd (/home/kurilovichay/.atom/packages/linter-rubocop/src/index.js:41:43) 
    at Object.<anonymous> (/home/kurilovichay/.atom/packages/linter-rubocop/src/index.js:212:27) 
    at next (<anonymous>) 
    at step (/home/kurilovichay/.atom/packages/linter-rubocop/src/index.js:11:273) 

其中rubocop回報:

/usr/local/bin/rubocop 

這是錯的?

+0

您是否在應用程序中添加了寶石rubocop? – Deep

+1

我剛剛做了這個 'gem install rubocop' –

+0

聽起來像一個拙劣的安裝。 –

回答

2

看來您正在使用rvm來管理您的環境。我做了什麼得到它的工作就是按照自己的回購說明:https://github.com/AtomLinter/linter-rubocop#settings

# make sure I'm in the global gemset 
$ rvm gemset use global 
# install the gem 
$ gem install rubocop 

配置原子使用全局。編輯您的原子的配置文件(config.cson),並添加

*: 
    "linter-rubocop": 
    executablePath: "~/.rvm/gems/[email protected]/wrappers" 
    "linter-ui-default": {} 

注:請確保紅寶石版本是你使用的一個。

相關問題