Closed smoothdvd closed 5 years ago
@castwide In vscode:
[Error - 11:18:47 AM] Server initialization failed.
Message: [SystemExit] VERSION= must be specified
Code: -32603
I just install solargraph gem 0.22.0 under ruby 2.2.7
I'm afraid I've never seen that error. My first suspicion is that it's an environment issue.
What OS are you using?
What happens when you run solargraph socket
from a terminal?
same issue here on an ubuntu 16.04.
I use rbenv so I had to add solargraph.commandPath
to my settings.
./path/solargraph socket
on the terminal works fine.
solargraph socket
says command does not exist as expected. As rbenv is not mapped in the system path.
I has the same issue on mac os when use rbenv. but set VERSION environment variable fixed this problem.
export VERSION="2.2.0"
I think this is an environment issue however it is strange that with even adding export VERSION="2.2.0"
to the ~/.bash_profile
is not working for me personal. Does anyone else know where to place those variables so that the Solargraph extension will pick it up?
@newdark The export worked to set the version for me but I still needed to add "solargraph.commandPath": "~/.rbenv/versions/2.3.5/bin/solargraph"
to my user settings file.
That was because it didn't recognize the gem inside rbenv. Don't know if it's your case.
Gave that a try seams to have no effect on its ability to get the VERSION
. The solargraph socket
command works fine and boots up correctly. Just VS Code for some reasons does not load the same bash data. I will trying adding the export to ~/.bashrc
or something and see if it will resolve the issues with it not being able to figure out the ruby version.
So it turned out the issue was the solars graph was installed in two locations. one was in a vender folder on the local project for me and the other was in my shim /Users/brandt.lareau/.rbenv/shims/solargraph
. I found the solution was to spend some time trying to uninstall all the different gems in all the different locations on my computer. I think there is no easy fix for this on each persons computer. However it would be nice if there was a better way to debug what commands where running and what the shell environment looks like when trying to fix this.
Here are some commands I had to run.
gem uninstall -i /Users/brandt.lareau/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0 rake
gem cleanup
bundle cleanup
rm -rf ./vender
The vendor command was uniq to me because there was a ./bundle/config
file that told it to save gems to the that path.
I could reproduce this problem.
$ mkdir testapp
$ cd testapp
$ bundle init
$ echo 'gem "kgio", "2.11.2"' >> Gemfile
$ bundle install --path vendor/bundle
$ code .
$ code app.rb
Probably this error is output from kgio.gemspec
.
$ head -n 1 vendor/bundle/ruby/2.5.0/gems/kgio-2.11.2/kgio.gemspec
ENV["VERSION"] or abort "VERSION= must be specified"
Developer tools' log:
console.ts:136 [Extension Host] Solargraph is listening PORT=58596 PID=49708
console.ts:136 [Extension Host] Checking gem version
console.ts:136 [Extension Host] VERSION= must be specified
console.ts:136 [Extension Host] VERSION= must be specified
/Users/hokamura/testapp/vendor/bundle/ruby/2.5.0/gems/kgio-2.11.2/kgio.gemspec:1:in `abort'
/Users/hokamura/testapp/vendor/bundle/ruby/2.5.0/gems/kgio-2.11.2/kgio.gemspec:1:in `load'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/specification.rb:1194:in `eval'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/specification.rb:1194:in `load'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/workspace.rb:145:in `block in generate_require_paths'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/workspace.rb:144:in `each'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/workspace.rb:144:in `generate_require_paths'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/workspace.rb:85:in `require_paths'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/library.rb:363:in `bundle'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/library.rb:11:in `initialize'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/library.rb:340:in `new'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/library.rb:340:in `load'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/host.rb:199:in `prepare'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/message/initialize.rb:8:in `process'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/host.rb:75:in `start'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/socket.rb:19:in `process'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/socket.rb:13:in `block in post_init'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/data_reader.rb:53:in `parse_message_from_buffer'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/data_reader.rb:31:in `block in receive'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/data_reader.rb:26:in `each_char'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/data_reader.rb:26:in `receive'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/language_server/transport/socket.rb:27:in `receive_data'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/lib/solargraph/shell.rb:25:in `socket'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
/Users/hokamura/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/solargraph-0.28.2/bin/solargraph:5:in `<top (required)>'
/Users/hokamura/.rbenv/versions/2.5.1/bin/solargraph:23:in `load'
/Users/hokamura/.rbenv/versions/2.5.1/bin/solargraph:23:in `<main>'
notificationsAlerts.ts:42 [SystemExit] VERSION= must be specified
This error should be resolved by one of two solutions:
If anyone still has this problem, please feel free to comment or open a new issue.
Can you provide more detail? I can't tell where you may have seen that message or what might have triggered it.