Open Nowaker opened 5 years ago
Having the same issue
[Error - 4:08:10 PM] Server initialization failed.
Message: [LoadError] incompatible library version - /Users/arg/.rvm/gems/ruby-2.6.2@global/gems/psych-3.1.0/lib/psych.bundle
Code: -32603
@Nowaker sorry for the delay in replying. I let this issue slip under my radar somehow.
Do either of you get a backtrace or any additional information in the developer console?
A cursory search suggests that the problem could stem from a version discrepancy with a native library like libxml2, but I'm not sure that's the case here. Example: https://stackoverflow.com/questions/18818926/incompatible-library-version-nokogiri-bundle-requires-version-11-0-0-or-later
Unfortunately, this is everything that shows up in VS Code. And as indicated in actual terminal window, Nokogiri is doing fine. So I guess the VS plugin itself could provide more debug information - e.g. print the stacktrace, maybe some environment like Ruby binary used.
Same here, macos:
[Error - 11:09:59 AM] Server initialization failed.
Message: [LoadError] incompatible library version - /Users/wyeworks/.gem/ruby/2.6.5/gems/nokogiri-1.10.5/lib/nokogiri/nokogiri.bundle
Code: -32603
No other debug information. Any workaround ?
This is how I solved the issue:
gem install --version 1.9.1 nokogiri
before I had nokogiri@1.10.1 and that one was the cause of mentioned incompatibility. Hope this helps others. Thanks
The only workaround I've found is to change my solargraph.commandPath
setting to point directly at the solargraph binary in my rvm gemset. No amount of messing with the version of nokogiri helped.
This is of course less than ideal if you are working on multiple projects.
I'm running 0.21.1. For some reason 0.22.0 is not available as a version to install.
@cancerberoSgx Advising to gem uninstall
something is not correct. Gem directory is shared across many projects, and each projects picks a version to use with Bundler.
vscode-solargraph likely has a bug that it does not pin the correct version of solargraph
and nokogiri
gems using Bundler, and instead, uses whatever is available to its dismay.
Advising to
gem uninstall
something is not correct.
Thanks. Comment edited. (I'm getting started with ruby).
$ gem list nokogiri
*** LOCAL GEMS ***
nokogiri (1.10.6, 1.10.5, 1.10.1, 1.9.1)
$ gem uninstall nokogiri -v 1.10.6
Successfully uninstalled nokogiri-1.10.6
everything ok again :)
Tried all solutions here, and the only one that worked was to add the commandPath to the solargraph gem in my VSCode settings.json file directly.
1- Get your solargraph gem path:
$ which solargraph
$ /Users/FORSBERGtwo/.rvm/gems/ruby-2.6.5/bin/solargraph
2- Open up VSCode settings.json
file, and add the following line to your config:
"solargraph.commandPath": "/Users/FORSBERGtwo/.rvm/gems/ruby-2.6.5/bin/solargraph",
3- Restart VSCode
Drawback to this is it points to a specific Ruby version of the gem
I had the same issue, I resolved mine by removing rm /Users/argi/.gem/ruby/2.6.0/gems/nokogiri-1.10.4/lib/nokogiri/nokogiri.bundle
and did bundle install
I don't know what the problem is but Nokogiri gem is alright.
Happy to provide more info if needed, just let me know what.