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

wrong ruby version being used ( rvm ) #390

Closed
btoconnor opened this issue Nov 10, 2020 · 5 comments
Closed

wrong ruby version being used ( rvm ) #390

btoconnor opened this issue Nov 10, 2020 · 5 comments

Comments

@btoconnor
Copy link

Hello - when trying to use solargraph, it seems to be utilizing the wrong ruby version.

This is illustrated when I run download-core command:

$ solargraph download-core
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Downloading docs for 2.7.1...

However, the ruby version in use is currently 2.7.2:

$ ruby -v
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
$ cat .ruby-version
ruby-2.7.2

This appears to be manifesting in other ways as well - when I run solargraph bundle I get the following error:

$ solargraph bundle
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Traceback (most recent call last):
        22: from /home/brian/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:24:in `<main>'
        21: from /home/brian/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:24:in `eval'
        20: from /home/brian/.rvm/gems/ruby-2.7.2/bin/solargraph:23:in `<main>'
        19: from /home/brian/.rvm/gems/ruby-2.7.2/bin/solargraph:23:in `load'
        18: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/bin/solargraph:5:in `<top (required)>'
        17: from /home/brian/.rvm/gems/ruby-2.7.2/gems/thor-1.0.1/lib/thor/base.rb:485:in `start'
        16: from /home/brian/.rvm/gems/ruby-2.7.2/gems/thor-1.0.1/lib/thor.rb:392:in `dispatch'
        15: from /home/brian/.rvm/gems/ruby-2.7.2/gems/thor-1.0.1/lib/thor/invocation.rb:127:in `invoke_command'
        14: from /home/brian/.rvm/gems/ruby-2.7.2/gems/thor-1.0.1/lib/thor/command.rb:27:in `run'
        13: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph/shell.rb:194:in `bundle'
        12: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph/documentor.rb:26:in `document'
        11: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph/documentor.rb:61:in `specs_from_bundle'
        10: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph.rb:67:in `with_clean_env'
         9: from /home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/bundler.rb:381:in `with_unbundled_env'
         8: from /home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/bundler.rb:677:in `with_env'
         7: from /home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/bundler.rb:381:in `block in with_unbundled_env'
         6: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph/documentor.rb:62:in `block in specs_from_bundle'
         5: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph/documentor.rb:62:in `chdir'
         4: from /home/brian/.rvm/gems/ruby-2.7.2/gems/solargraph-0.39.17/lib/solargraph/documentor.rb:67:in `block (2 levels) in specs_from_bundle'
         3: from /home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/open3.rb:281:in `capture3'
         2: from /home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/open3.rb:101:in `popen3'
         1: from /home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/open3.rb:213:in `popen_run'
/home/brian/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/open3.rb:213:in `spawn': No such file or directory - bundle (Errno::ENOENT)

And here's my $PATH:

/home/brian/.rvm/gems/ruby-2.7.2/bin:/home/brian/.rvm/gems/ruby-2.7.2@global/bin:/home/brian/.rvm/rubies/ruby-2.7.2/bin:/home/brian/.rvm/bin:/home/brian/.local/bin:/home/brian/.local/bin:/home/brian/.nvm/versions/node/v12.16.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/snap/bin
@castwide
Copy link
Owner

  1. Ruby 2.7.2 maps are not currently available, so download-core fetches 2.7.1 instead. This download is for documentation purposes only. It doesn't affect the runtime. I'll update the Ruby version archives later this week.

  2. Does it work if you run bundle exec solargraph bundle?

@castwide
Copy link
Owner

Update: documentation for Ruby 2.7.2 (and several other versions) is now available via download-core.

@btoconnor
Copy link
Author

Thanks for the update. I didn't realize that about the maps. I think the rvm issue may have been something whacky with my machine's configuration, and it's not showing up anymore. If I see this happen again, I can try and comment here again, but I think this issue is safe to close.

@smackesey
Copy link

Just want to say that I think that either the docs should be adjusted, or download-core should explain itself when it downloads different docs. I'm just getting started and I was immediately confused by this (I'm using Ruby 3 and it downloaded 2.7.2), since the Getting Started Page implies that download-core should fetch docs for current Ruby version. So it looks like a bug even if it isn't.

@castwide
Copy link
Owner

In 0.42.0, solargraph download-core provides a notice when it uses the nearest matching core documentation instead of the current version.

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

No branches or pull requests

3 participants