Closed aruprakshit closed 5 years ago
It looks like there's a discrepancy between the version of Ruby you're trying to use (2.3) and the version getting used from VS Code (based on the error message, 2.4). I'm guessing the system/default version is 2.4?
You should be able to specify which version Solargraph should use from VS Code by adding a .ruby-version file to your workspace.
@castwide I already hardcoded it as you see "solargraph.commandPath": "/Users/aruprakshit/.rvm/gems/ruby-2.3.3@global/bin/solargraph"
, but still it is not picking up.
That's why I suggested a .ruby-version file. The error indicates that VS Code is correctly running the solargraph script in 2.3, but it's using the 2.4 interpreter. Testing from the command line on CentOS, I got the same error using an absolute path to an installation of solargraph that didn't match the version of Ruby in use via rvm. The gem's executable doesn't change the interpreter.
I can try some more tests on MacOS later. I don't think I've ever set solargraph.commandPath
in conjunction with systems using rvm. I've only ever needed it on certain Windows setups.
@castwide I'll try and let you know.
@castwide I removed solargraph.commandPath
and added .ruby-version
. Now it is working. Is .ruby-version
needed as I am using RVM
?
@aruprakshit It's the easiest way I know to select a Ruby version other than the system default.
Hi,
I do have below settings:
But when I open the folder in my editor (VSCode), I see below error: