I am using "RVM" which is pre-installed in Cloud9 environment.
You can check it on the official website. Ruby download page As of June 3, 2020, the latest stable version was 2.7.1.
The list command displays a list of installed (switchable) Ruby versions.
rvm list
The version included by default was not 2.7.1, so install it additionally.
rvm list known
A list of installable Ruby versions is displayed.
The part enclosed in [] is the part that can be omitted when specifying the version.
The MRI list did not include the version "2.7" of Ruby I wanted to install. In this case, RVM needs to be updated.
Update RVM on AWS Cloud9 --Qiita
Note: MRI (Matz'Ruby Implementation) is the most common Ruby processing system.
To install version 2.7, enter the command as follows:
rvm install 2.7
After processing, check if the installation was successful.
rvm list
Shows a list of Ruby versions installed in.
Installation is complete.
You can also check the current version with the ruby command.
ruby -v
The writing method is the same as when specifying loosely.
To install version 2.3.1, enter the command as follows.
rvm install 2.3.1
Press the Enter key to start the installation.
Check if it was installed.
rvm list
You can see that 2.3.1 has been added.
=> --current (current version of Ruby) = * --current && default (currently in use and default version)
rvm use <version>
For example, to use 2.7.0, execute the following command.
rvm use 2.7.0
To check if it has switched, use rvm list
.
The version currently in use is selected with "=>" or "= *".
You can also check the current version with the ruby command.
ruby -v
Command to set 2.7.0 as the default
rvm --default use 2.7.0
Check with rvm list
The default mark is marked with "*".
rvm remove <version>
Enter the version you want to remove and run the command.
rvm remove 2.3.8
When the process is finished
rvm ls
If it disappears from the list with, you can confirm that it has been deleted.
Recommended Posts