gpt4 book ai didi

ruby - VScode 上的 rubocop 不起作用。错误 "rubocop is not executable"

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

最近我在 vscode 上安装了 rubocop。但是,它不起作用。错误消息如下。

rubocop is not excutable 
execute path is empty! please check ruby.rubocop.executePath

我该如何解决?我搜索了一些文章,一直没有解决...

比照。 vscode-ruby-rubocop https://github.com/misogi/vscode-ruby-rubocop

最佳答案

接受的答案对我不起作用。但是,我确实找到了 jdarnok 的评论关于这个GitHub issue这对我有用。

首先,为了获取程序文件的用户路径,我运行了:

rbenv which rubocop

这给了我这个结果:

/Users/<your username>/.rbenv/versions/2.6.2/gemsets/Rails4.2_EnergyLink/bin/rubocop

然后我跑了:

which rubocop

这给了我这个结果:

/Users/<your username>/.rbenv/shims/rubocop

解决方案

Ruby > Rubocop: Execute Path 下的 VS Code 设置中我粘贴:

/Users/<your username>/.rbenv/shims/

其他可能的解决方案

Stackoverflow post指的是其他一些可能的解决方案,例如:

  • 替换bin在带有 wrappers 的路径中
  • 刷新executable hooks
  • 更新 bundler
  • 更新 gem

关于ruby - VScode 上的 rubocop 不起作用。错误 "rubocop is not executable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53367947/

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