Can't Change Rvm Default

Can't change RVM default

You have multi-user installation, but I provide also information/instructions for user installation.

For multi-user installations:

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.

For user installations:

you need to update your .*rc configuration files for --default to take effect:

rvm get stable --auto

and restart your computer.

Restart required for both

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.

Default in scripting

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)

Can't change default Ruby version in RVM

I'm not sure what command you're using to change the ruby version in rvm, you didn't specify. My hunch is you're using rvm use, this is only temporary for the shell session. To change it permanently use rvm default:

rvm --default use ruby-2.1.0

This change will persist to new shell sessions.

RVM: Can set the default ruby version but cannot set the current version

For me following command doing the work

rvm --default use 2.2.2

You might have issue with login shell and required to use /bin/bash --login as the command

how to set default ruby with rvm

Typing rvm list will give you a list of the installed rubies you have, like this:

    ree-1.8.7-2010.02 [ i686 ]
ruby-1.8.7-p249 [ i686 ]
ruby-1.9.2-p180 [ x86_64 ]
ruby-1.9.2-p180-patched [ x86_64 ]
ruby-1.9.2-p290 [ x86_64 ]
ruby-1.9.2-p290-webkit [ x86_64 ]
=* ruby-1.9.3-p194 [ x86_64 ]

If the one you want is ruby-1.9.3-p194, then type:

rvm --default use  ruby-1.9.3-p194

First, be careful to follow the installation instructions closely and make sure it's working.

You should also see this line in your bashrc as well:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"  

Then try opening a new shell or try typing:

source ~/.rvm/scripts/rvm

But in general if you're having issues, I'd recommend just re-installing rvm -- it doesn't take long and it's easy:

curl -L get.rvm.io | bash -s stable

Ubuntu ruby version keeps changing even after specifying default version in rvm

Check that .bash_profile contains below lines:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Check .bashrc, .zshrc, .mkshrc file contains below lines at end of file:

export PATH="$PATH:$HOME/.rvm/bin"

if not then,

First Run below command then follow link to install rvm:

rm -rf ~/.rvm

RVM Install

RVM doesn't switch Rubies

Typically rvm support is easiest via IRC (#rvm on freenode) - in this particular case, what does running "type rvm | head -n1" show? it should show "rvm is a function". If not, that means the line to source rvm isn't being run correctly and hence switching doesn't work. Typically this means you either have a return in your ~/.bashrc or you missed adding the line to source rvm.



Related Topics



Leave a reply



Submit