How to install Ruby version manager (RVM) on Ubuntu
Applications for Ruby often require different versions of Ruby, and only one version is usually installed from packages, and not necessarily the latest. Particular difficulties arise when different applications on the same server require different versions of Ruby. To eliminate this drawback, there is Ruby Version Manager (RVM), which deals with Ruby version control, physically separates versions, and also allows you to create separate gemsets for each version of Ruby (within each version of Ruby you can have several sets of gems).
You can install RVM for a specific user or for all users. If the installation is done for all users, then everything is done from root or using sudo. Let’s start the installation of RVM (the installation process for all users is described) in this post.
sudo apt–get install curl git
sudo gpg –keyserver hkp://pool.sks-keyservers.net –recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or
curl -sSL https://rvm.io/mpapis.asc | sudo gpg –import –
curl -sSL https://rvm.io/pkuczynski.asc | sudo gpg –import –
\curl -sSL https://get.rvm.io | bash -s stable –ruby
Run command:
source /home/username/.rvm/scripts/rvm
usermod –a –G rvm username
rvm list known
rvm install Ruby_version
rvm list
rvm use ruby Ruby_version —default
Create a gemsets set (all gemsets are created for a specific version of Ruby):
rvm use Ruby_version@set_name –create
View available gemsets:
rvm gemset list
rvm use 2.6.0@test —default
rvm gemset empty gemset_name
rvm gemset delete gemset_name