Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ruby

rvm

I want to use ruby 2.3.4 for my rails application which I have installed using rvm on Ubuntu 16.04.

after using command rvm list.

rvm rubies

=* ruby-2.3.4 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

but when i use ruby -v I get.

ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]

so I used rvm --default use 2.3.4.

which does change the version to 2.3.4 when I check using ruby -v but when I restart the terminal or system it changes back to 2.5.0

I want to know how to include 2.5.0 into rvm or remove it.

like image 271
Gautam Chibde Avatar asked Sep 10 '26 03:09

Gautam Chibde


1 Answers

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

like image 189
Prince Bansal Avatar answered Sep 13 '26 05:09

Prince Bansal