castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 24 forks source link

Unable to start solargraph #66

Closed huangxg closed 6 years ago

huangxg commented 6 years ago

OS: macOS 10.13.5 ruby: 2.3.3 (set by .ruby-version) solargraph gem: 0.22.0 vscode: 1.24.1 Ruby Solargraph: 0.17.4

When loading a ruby file in vscode, there is a message Starting the Solargraph language server... at the bottom blue bar, and two repeated errors in the OUTPUT tab, [Error - 14:43:51] Connection to server is erroring. Shutting down server.

castwide commented 6 years ago

Are there any messages in the developer console?

What happens when you run solargraph socket from a terminal?

huangxg commented 6 years ago

Dev console messages,

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Run `npm config delete prefix` or `nvm use --delete-prefix v8.11.3 --silent` to unset it.

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Solargraph is listening PORT=51133 PID=41536

/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Checking gem version
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:268 [Extension Host] Solargraph gem version is current

Terminal message,

Solargraph is listening PORT=7658 PID=44535
castwide commented 6 years ago

Do you have 127.0.0.1 set to localhost in your hosts file? (Reference: #67)

huangxg commented 6 years ago

No, my 127.0.0.1 was set to another domain name. Changing it back to localhost did fix the problem. solargraph was working even when 127.0.0.1 was set to that domain, util something (not sure it's ruby, macOS, or vscode) updated recently.

Thank you, @castwide

AntonTrapp commented 5 years ago

Just FYI: If anybody comes to this page because of the same problem and google and the hosts is correct, restart VS Code (if needed multiple times), sometimes (not often) it seems to freeze. Maybe it's happening when switching branches while it's starting? At least I did that the last time when I had this problem.