Solargraph not working in Visual Studio Code - ruby

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!

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.

I found the solution you should gem install solargraph. If not work and get this error
ERROR: Loading command: install (ArgumentError)
unknown encoding name - CP720
ERROR: While executing gem ... (NoMethodError)
undefined method "invoke_with_build_args" for nil:NilClass
Try to execute by administrator in CMD
chcp 1252
Then try to install gem again
Enjoy!

Try executing
solargraph -v
from the VS Code terminal.
If that gives an error try
gem install bundler:1.17.3

I was getting errors with every keystroke similar to:
[Error - 6:08:49 PM] Request textDocument/completion failed.
Message: [ArgumentError] wrong number of arguments (given 1, expected 0)
Code: -32603
I'm using VSCodium, I changed a configuration in order to install "official" extensions. I re-installed all extensions, including Solargraph, that's when this started happening.
In the end, restarting editor via Developer: Reload Window fixed it.

Related

An error occurred while installing jekyll-sitemap (0.11.0)

I try to build an Octopress in my PC, but when I executed bundle install in git bash. The results showed
Errno::EINVAL: Invalid argument - D:/Ruby/lib/ruby/gems/1.9.1/gems/jekyll-sitemap-0.11.0/spec/fixtures/_posts/2016-04-01-ih
I don't know how to fix it , please help, thank you!

Invalid argument error installing 'ruby-box' gem

Any ideas why I get this error when trying to install the ruby-box gem?
C:\>gem install ruby-box
ERROR: While executing gem ... (Errno::EINVAL)
Invalid argument - C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ruby-box-1.2.0/spec/fixtures/i☺ e?↨f§↓.jpg
It seems to be complaining about the ruby-box-master\spec\fixtures\遠志教授.jpg file, which is not written in English.
You should probably move to the newer ruby SDK: https://github.com/attachmentsme/ruby-box
It is all built on the V2 API. V1 API will be shut down at the end of 2013.
Update ruby-box to 1.2.1 (still need to test it)

Ruby gems installation error

When I am trying to install a gem or run anything with gem command, I see this warning,
Error loading RubyGems plugin "/Users/ender/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-0.9.0/lib/rubygems_plugin.rb": undefined method `first' for #<String:0x007ffedc0964f0> (NoMethodError)
I searched it but I could not find anything out.
What is the problem and how can I fix it?
Note: I cannot install any gems.
Thanks.
Try removing the /Users/ender/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-0.9.0 directory. There seems to be a problem with this gem.

Rake failing to start

I'm having trouble understanding the following error with Ruby's Rake.
C:\>gem install rake
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
C:\>rake
C:/Ruby192/lib/ruby/1.9.1/rubygems.rb:340:in `bin_path': can't find executable r
ake for rake-0.8.7 (Gem::Exception)
from C:/Ruby192/bin/rake:19:in `<main>'
Running Ruby 1.9.2 for Windows.
Edit: Installing from source yields:
C:\Documents and Settings\XPherior\Desktop\rake-0.8.7\rake-0.8.7>ruby install.rb
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load --
ftools (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from install.rb:3:in `<main>'
The second error, where you have installed into C:\Documenets And Settings\ is occurring because you cannot install ruby into a folder with a space in the path. It should be installed into c:\Ruby\ c:\Ruby#.#.#\ if you want the version # in the path, or something along those lines.
for the first error: there is a bug in the rubyinstaller.org version of ruby 1.9.2, which is causing this by running "gem install rake".
you can read about the error you're getting, here: http://redmine.ruby-lang.org/issues/show/3677
there are a couple of ways to fix this error:
re-install ruby v1.9.2 and don't run "gem install rake". rake v0.8.7 is built into the ruby v1.9.2 installation, so you don't need to re-install it.
if you do want to manually install it, you can delete the ruby.gempspec file from your ruby installation. this file is located at (rubyinstalldir)\lib\ruby\gems\1.9.1\specifications
either of these options will fix the problem for you.
i'm not sure which is "better" off-hand... it may be necessary to delete the gemspec file and reinstall rake, to support updates and new versions in the future. i'm not sure, though. we'll find out once rake is updated and we need to install a new version. or, perhaps, the issue will be fixed in the ruby installation by then, and we'll just need to update our ruby install.
I've run into your both errors.
For the first one. Try the solution post at here http://betterlogic.com/roger/2010/11/ruby-1-9-2-rake-woe/.
And for the second error, it's causes by a library update by the ruby 1.9. From the Programming Ruby 1.9, "ftools have been removed (and replaced by fileutils)." I'm not pretty sure but at least that's an explanation.

Changing where passenger looks for RubyGems

I've installed the Passenger Preference Pane on OSX but whenever I try to run an app I get a 500 Internal Error. Looking at the log gives me the following error:
/usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb:25:in `require': no such file to load -- rubygems (LoadError)
from /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb:25
from /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.5/bin/passenger-spawn-server:53:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.5/bin/passenger-spawn-server:53
[ pid=403 file=ext/apache2/Hooks.cpp:725 time=2009-11-15 23:33:38.110 ]:
Unexpected error in mod_passenger: Cannot spawn application '/Users/waynemolina/Projects/sandbox/rack-hello-world': The spawn server has exited unexpectedly.
Backtrace:
in 'virtual boost::shared_ptr Passenger::ApplicationPoolServer::Client::get(const Passenger::PoolOptions&)' (ApplicationPoolServer.h:471)
in 'int Hooks::handleRequest(request_rec*)' (Hooks.cpp:521)
Since rubygems works everywhere else, I can only assume this error is because Passenger is looking in the wrong place for Rubygems. I installed Rubygems manually and it's located in /usr/local/bin/gem according to which gem. However, whereis gem returns /usr/bin/gem instead. I'm more than a little confused on what steps I need to take to fix this short of just reinstalling OSX and upgrading the built-in RubyGems install instead of installing it myself.

Resources