ruby-build
ruby-build copied to clipboard
Add small note to use `rbenv global` after `rbenv install`
Installing Ruby from scratch and I just spent way too long figuring out that you have to rbenv global [version] after install. It was only because I remembered from a few months ago when I last installed from scratch that I didn't pull my hair out and give up :/
How about rbenv install suggesting this to you instead once you installed a version but you don't have a global version set? That way users would be reminded to do this even if they didn't read the documentation thoroughly (which they seldom do).
However I don't understand why this was such a hair-puller for you. A single rbenv version would have told you that you're currently using "system" version set by RBENV_ROOT/version file. After that it's just a matter of you picking what other version do you need by either rbenv global, rbenv local or rbenv shell. What was unclear at this point?
Thanks, that's actually made it clearer what happened. The specific error message I got after installing a ruby version was;
rbenv: version `system' is not installed
Only now, after reading your response do I understand that message. At the time I thought system was a gem (because I was trying to do gem install bundler) and that the latest version of it wasn't installed. Now I see that system refers to a 'version' of ruby.
Right, so I can be very specific about the issue now: Not only did I not have a rbenv global version set, I didn't have a native system ruby installed either! So now I actually think the ideal solution would be an improvement to that error message. For example;
rbenv: the current version of ruby is set to `system', but it is not installed
It would of course also be nice if rbenv install gave a message if there was no currently set value for rbenv global.
or short:
rbenv: ruby version `system' is not installed
+1 to tell users to set a version globally.
Fixed in https://github.com/rbenv/ruby-build/pull/2052