Using Rvm, But Can't Set Current Ruby Version (Ubuntu 11.10)

Using RVM, but can't set current Ruby version (Ubuntu 11.10)

RVM 1.6.9 is very old now. Did you install it through some package manager? If so, get rid of it and run the following in your bash shell:

curl -L https://get.rvm.io | bash -s stable

Then, place [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" in ~/.profile OR ~/.bash_profile OR ~/.bashrc

You should then be able to run type rvm | head -n 1 and it should say "rvm is a function".

Then you should be able to install rubies and use one of them. Be sure to use --default for that Ruby to remain the default even after you end your terminal session. E.g. rvm use ruby-1.9.2-p290 --default

rvm does not set ruby version

looking at the output of your rvm list, you have two rubies installed, none of them default.

Looks like you just missed the step to make 1.9.2 the default.

And it seems you didn't modify your .bash_profile file

See Step 3 on this page:

http://beginrescueend.com/rvm/install/

Your file ~/.bash_profile should contain this line:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

(make sure to start a new shell, after modifying .bash_profile)

Then run this: (to set the default Ruby version)

rvm --default use 1.9.2

ruby -v

See also:

http://beginrescueend.com/rubies/default/

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 --default not setting 1.9.2 ubuntu 11.10 + can't install rails

You have a system install of ruby in /usr/bin that takes precedence over the rvm versions. Make sure something like ~/.rvm/rubies/your-ruby-version/bin is in your PATH environment variable before /usr/bin. When you install rvm, you should get instructions to put this:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.

somewhere into a file that is sourced when starting a shell, such as ~/.bashrc.

Unable to install ruby using RVM on WSL 2 and Ubuntu

I can reproduce this exact error if I try rvm install 3.1.2 without having added my user to the rvm group per the installation instructions. Is it possible that you missed this step?

sudo usermod -a -G rvm $USER

After adding the user, then exiting the shell/WSL and restarting, rvm install 3.1.2 (almost) worked as expected. It appears there's a slight bug where it asks for the sudo password on the same line as a previous Updating system.. line, so it's easy to miss, but this is recoverable.

Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

You have broken version of RVM. Ubuntu does something to RVM that produces lots of errors, the only safe way of fixing for now is to:

sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh

open new terminal and validate environment is clean from old RVM settings (should be no output):

env | grep rvm

if there was output, try to open new terminal, if it does not help then restart your computer.

install RVM:

\curl -L https://get.rvm.io | 
bash -s stable --ruby --autolibs=enable --auto-dotfiles

If you find you need some hand-holding, take a look at Installing Ruby on Ubuntu 12.04, which gives a bit more explanation.

Need to set ruby version each time a terminal session is started

Check in your gemfile if there is a references to 1.9.3

If not, check this answer and follow the instructions How to set default Ruby version with RVM?



Related Topics



Leave a reply



Submit