Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solargraph not working in Visual Studio Code

I have the following error in my VS Code:

[Error - 3:51:12 PM] Starting client failed
/usr/local/Cellar/ruby/2.6.3/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem solargraph (>= 0.a) with executable solargraph (Gem::GemNotFoundException)
    from /usr/local/Cellar/ruby/2.6.3/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
    from /usr/local/bin/solargraph:23:in `<main>'

I currently use rbenv and have as global and only Ruby version 2.6.3 What seems to be the problem here? why do I see a ruby/2.6.0/ above if the version is 2.6.3?

Thanks for the help!

like image 206
noloman Avatar asked Apr 26 '19 13:04

noloman


People also ask

Where is Solargraph installed?

The default location is ~/. solargraph/cache , e.g., /home/<username>/.

What is Ruby Solargraph?

Solargraph is a Ruby gem that provides intellisense features through Microsoft's language server protocol. Features: Context-aware autocompletion. Documentation for the Ruby core. Gem support.

What is Ruby language server?

Ruby is an open-source object-oriented scripting language invented in the mid-90s by Yukihiro Matsumoto. Unlike languages such as C and C++, a scripting language doesn't talk directly to hardware. It's written to a text file and then parsed by an interpreter and turned into code.


1 Answers

If all else fails, you can try setting solargraph.commandPath to the executable's absolute path. Running which solargraph should give you the path to use.

like image 127
castwide Avatar answered Sep 19 '22 19:09

castwide