"Solargraph gem not found."で困ったが解決した
SolargraphはVScodeのRuby用コード補完プラグインです。
導入方法は
と同じです。
"solargraph.commandPath": "C:\\Ruby24-x64\\bin\\solargraph.bat"
とすることをお忘れなく。
んで、動くと思ったら...
こうなってしまいました。 「Install Now」を押しても解決しませんでした。
Issuesを見て
A few other questions:
- What operating system are you using?
- What version of Ruby?
- What version of the vscode-solargraph extension?
- Do you have any other extensions installed?
- What version of the Solargraph gem? (Run
gem list solargraph
)- Does running
solargraph help
return a list of commands?- Did you change any of the Solargraph configuration settings?
とあるので一つずつ確認すると
solargraph help
が動いてないことがわかりました。
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require 'em/pure_ruby' でググる。
どうやら --platform ruby をつけてEventMachineを再インストールすればよさそうなので
アンインストールして
gem uninstall eventmachine
再インストール
gem install eventmachine --platform ruby
そしてVScodeを再起動すると
動きました!
Issuesをしっかり読むのは当たり前ですがとても大切ですね。
それにしてもやっぱりWindowsとRubyの相性は良くないなと環境構築しながら思いました。
早くMacBook Pro買いたいな~