gpt4 book ai didi

ruby-on-rails - Atom-Editor:Rubocop 不适用于 atom

转载 作者:数据小太阳 更新时间:2023-10-29 07:55:00 24 4
gpt4 key购买 nike

我试图将 rubocop 连接到 atom,但收到错误:

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/ruby-2.3.1@global', 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

有人可以帮忙吗?

最佳答案

看来您正在使用 rvm 来管理您的环境。我所做的就是按照他们的 repo 上的说明进行操作: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

配置原子使用全局。编辑你的 atom 的配置文件 (config.cson) 并添加

*:
"linter-rubocop":
executablePath: "~/.rvm/gems/ruby-2.3.1@global/wrappers"
"linter-ui-default": {}

注意:确保 ruby​​ 版本是您正在使用的版本。

关于ruby-on-rails - Atom-Editor:Rubocop 不适用于 atom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43479200/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com