美文网首页
VSCode配置ruby开发环境

VSCode配置ruby开发环境

作者: 三三At你 | 来源:发表于2019-10-07 17:04 被阅读0次
brew install rbenv
rbenv install 2.6.3
rbenv global 2.6.3
rbenv init
gem install ruby-debug-ide
gem install rcodetools
gem install solargraph
echo $PATH

然后给vscode添加一个config
设置launch.json
把echo $PATH的结果放到env的PATH里

可能还需要下面的配置

{
    "window.zoomLevel": 0,
    "ruby.codeCompletion": "rcodetools",
    "ruby.format": "rubocop",
    "ruby.intellisense": "rubyLocate",
    "ruby.useLanguageServer": true,
    "ruby.useBundler": true,
    "ruby.pathToBundler": "~/.rbenv/shims/bundle",
    "ruby.interpreter.commandPath": "ruby",
    "ruby.locate": {
        "exclude": "{**/@(test|spec|tmp|.*),**/@(test|spec|tmp|.*)/**,**/*_spec.rb}",
        "include": "**/*.rb"
    },
    "ruby.rctComplete.commandPath": "~/.rbenv/shims/rct-complete",
    "solargraph.autoformat": true,
    "solargraph.bundlerPath": "~/.rbenv/shims/bundle",
    "solargraph.formatting": true,
    "solargraph.commandPath": "~/.rbenv/shims/solargraph"
}

相关文章

网友评论

      本文标题:VSCode配置ruby开发环境

      本文链接:https://www.haomeiwen.com/subject/crweuctx.html