Skip to content
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

asdf: No preset version installed for command solargraph #37

Open
kaka-ruto opened this issue Jun 23, 2020 · 6 comments
Open

asdf: No preset version installed for command solargraph #37

kaka-ruto opened this issue Jun 23, 2020 · 6 comments

Comments

@kaka-ruto
Copy link

kaka-ruto commented Jun 23, 2020

I had an issue with my Ruby installation using asdf-ruby. So I deleted that installation (Ruby 2.5.1) and reinstalled it.

I also uninstalled all Solargraph gems just incase they were pointing to an old Ruby installation path, and did another gem install solargraph

solargraph -v or opening a Ruby file in Vim throws an error

asdf: No preset version installed for command solargraph
Please install the missing version by running one of the following:

asdf install ruby 2.5.1

I can confirm that the ruby version is installed.

I am using coc-solargraph and tried setting solargraph.commandPath to /Users/kaka/.asdf/shims/solargraph but it didn't work.

I have other Ruby versions (using asdf as well) and their Solargraphs seem to work well

@kaka-ruto
Copy link
Author

kaka-ruto commented Jun 25, 2020

@chemzqm any recommendations I should try to troubleshoot or give more info?

Here's a screenshot of what I get

Screen Shot 2020-06-25 at 14 18 39

@chemzqm
Copy link
Member

chemzqm commented Jun 26, 2020

No idea, should be problem with your ruby environment

@kaka-ruto
Copy link
Author

Thanks. I'm sure it's my Ruby env. Once I find something helpful I'll report here to help others and future me :)

@Nitrodist
Copy link

Maybe try asdf reshim

@hanh090
Copy link

hanh090 commented Sep 14, 2020

for me, it was mismatch solargraph version. try gem install solargraph in your project folder. I guess problem come from solargraph was install in another of ruby, then later on, ruby version changed, but it do not update new gem of solargraph

@henrik
Copy link

henrik commented Sep 16, 2021

If you put solargraph in ~/.default-gems, asdf should install it automatically when you install a new Ruby version.

More info to corroborate what @hanh090 said:

It seems like ~/.asdf/shims/solargraph will include the Ruby versions you've installed that gem through:

#!/usr/bin/env bash
# asdf-plugin: ruby 2.7.2
exec /usr/local/opt/asdf/bin/asdf exec "solargraph" "$@"

So with the shim above, it would work fine on Ruby 2.7.2 via asdf but not on another Ruby version. If I gem install solargraph again with that other Ruby version, it adds an # asdf-plugin: … line for it and solargraph -v will start working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants