I have problem changing the default ruby. Running OS X Lion.
macbook:~ work$ rvm list
rvm rubies
=* ruby-1.9.2-p290 [ x86_64 ]
ruby-1.9.2-p318 [ x86_64 ]
As you can see, 1.9.2-p290 is the default.
macbook:~ work$ rvm use --default ruby-1.9.2-p318
Using /usr/local/rvm/gems/ruby-1.9.2-p318
macbook:~ work$ rvm list
rvm rubies
* ruby-1.9.2-p290 [ x86_64 ]
=> ruby-1.9.2-p318 [ x86_64 ]
After running rvm use --default ruby-1.9.2-p318, the Ruby changed, but default is still p290. And the next time I reopen a shell, the ruby used is p290.
Any ideas?
Thanks.
You have multi-user installation, but I provide also information/instructions for user installation.
Multi-user installations use /etc/profile.d/rvm.sh - this file is sourced every time any shell is spawned, this includes when you login, anything you do is already working in context of the loaded earlier default.
You need to restart computer for this to make effect.
you need to update your .*rc configuration files for --default
to take effect:
rvm get stable --auto
and restart your computer.
Restart is required because the earlier default was loaded before/while logging in, with the updated config files the loading point moves to proper place and there should be no more problems with changing default.
When RVM is used as binary from $rvm_path/bin/rvm it can not set --default
as it's bound to use
and use is not working in scripting mode, you can use following commands to manage default:
rvm alias delete default
rvm alias create default 1.9.3
And to make it effective (replacement for rvm use default
):
source $(rvm default do rvm env --path)
I had the same problem and found this made my day:
sudo rvm alias create default <ruby-version>
and/or
rvm use <ruby-version> --default
This worked for me changing the default to 1.9.3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With