oni icon indicating copy to clipboard operation
oni copied to clipboard

Solargraph error with Ruby 2.5.1

Open npupko opened this issue 7 years ago • 7 comments

image

Oni Version: 0.3.6 Neovim Version: 0.3.1 Operating System: Mac OS Mojave 10.14.2 Solargraph: 0.29.4 Ruby: 2.5.1

Issue: Can not use language server with Oni

Expected behavior: Autocomplete for ruby

Actual behavior: Errors in console

Steps to reproduce: Just install Oni and add to config:

  "language.ruby.languageServer.command": "solargraph",
  "language.ruby.languageServer.arguments": ["stdio"],

npupko avatar Dec 13 '18 07:12 npupko

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Dec 13 '18 07:12 oni-bot

ENOENT seems like Oni can't find the executable for solargraph.

You can install the gem on your system ruby or tweak the command to find the executable, I use 2.5.1 here and it works.

badosu avatar Dec 14 '18 16:12 badosu

@badosu Does Oni work with RVM? Should I somehow configure it?

npupko avatar Dec 14 '18 21:12 npupko

@npupko Not sure, you would have to check which ruby version you're using and since this is a per-project configuration I don't think that would be feasible. Would be a good feature for an oni ruby plugin though.

If you want to use the default ruby version that RVM uses in your shell you should be able to find the executable by running which ruby or which solargraph.

badosu avatar Dec 26 '18 13:12 badosu

Closing as it is not actually a bug in Oni as far as I can see, please reopen if you're not able to use it with a system ruby or after specifying the RVM path for your installed solargraph.

badosu avatar Dec 27 '18 22:12 badosu

Thanks! I got it. Everything worked out

npupko avatar Jan 09 '19 06:01 npupko

Adding my experience here in case it helps someone:

I ran into the same issue. I use rbenv and my gems lived in /Users/mf/.rbenv/shims/solargraph. To get this working for Oni, I used this configuration:

export const configuration = {
     ...
    "language.ruby.languageServer.command": "/Users/mf/.rbenv/shims/solargraph",
    "language.ruby.languageServer.arguments": ["stdio"],
}

I had to restart the editor completely for this to take effect.

codeluggage avatar Mar 04 '19 03:03 codeluggage