-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about the setup of solargraph.commandPath #16
Comments
There are a few ways to handle this. I use rvm, and this is what I do. I install solargraph from a shell that uses my default version of ruby. i.e. My global coc configuration (edit with :CocConfig) contains: For my projects that I manage with a Gemfile (and perhaps use .ruby-version), I'll add solargraph to my Gemfile, and let bundler manage the installation. i.e. For this to work, I add a "workspace" configuration file (.vim/coc-settings.json) within my project, and it contains {
"solargraph.useBundler": true,
} (see https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file ) So, you will end up with multiple solargraph gems on your system. Globally, and for each project. However, the only reason I do this, is because I often edit ruby code that I do not manage with a Gemfile. For example, vagrant's configuration is done using ruby, and I like for solargraph to work everywhere. If you only code ruby from projects with a Gemfile, then you don't need to do all of this. Just set useBundler: true and bundle install. Caveat - If you use ZSH as your shell, make sure you source the RVM environment inside of your ~/.zprofile and not your ~/.zshrc. |
I don't like rvm since it change global environment, use a single global solargraph is recommended. |
@chemzqm How do you install a global one when you have rvm installed, that would be great to know. |
Don't know, I don't use rvm. |
If you are using rvm with a single version of ruby, you should have no problem using a global solargraph gem. The caveats are gemsets and different ruby versions. If you are switching ruby versions on a project basis, etc., then you will need to If you are using gemsets, then you will need to install solargraph for each gemset. Otherwise, it should work fine. |
@aruprakshit , What @AlanWarren said is right, With rvm you can install solargraph to the global gemset
However, the issue is, here global is scoped by the ruby version. (means, you'll have to install solargraph for each ruby version globally) Another option is (How I have done), is to give the command path , following is my coc-settings.json
|
For anyone still struggling with this and using RVM, I found that |
solargraph.commandPath:
I am using Rvm. How do I set up it to an absolute path, so that it can be found out across all the ruby versions? Do I need to install the gem for each ruby versions I have installed?
The text was updated successfully, but these errors were encountered: