AWS Cloud9 environment construction Update Ruby to the latest stable version

I am using "RVM" which is pre-installed in Cloud9 environment.

Check the latest stable version of Ruby today

You can check it on the official website. Ruby download page As of June 3, 2020, the latest stable version was 2.7.1.

Check the version of Ruby installed in the Cloud9 environment

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.

Display a list of Ruby versions that can be installed with RVM

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.

Install Ruby by loosely specifying the version

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

Install Ruby by specifying the version in detail

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. image.png

Meaning of symbols

=> --current (current version of Ruby) = * --current && default (currently in use and default version)

Switch the version of Ruby you are using

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

Set the version of Ruby to use by default

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 "*".

Remove the installed Ruby

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

AWS Cloud9 environment construction Update Ruby to the latest stable version
Update to the latest version without specifying the version with gradle wrapper
Ruby environment construction summary ~ mac version ~
[Note] Update to production environment (AWS EC2)
Update JAVA to the latest version to 1.8.0_144 (when downloading from the web and updating)
How to solve the local environment construction of Ruby on Rails (MAC)!
Introduction to Slay the Spire Mod Development (2) Development Environment Construction
Build a Ruby on Rails development environment on AWS Cloud9
Deploy to Ruby on Rails Elastic beanstalk (Environment construction)
From 0 to Ruby on Rails environment construction [macOS] (From Homebrew installation to Rails installation)
[Environment construction] Get the Ruby on Rails 6 development environment within 1 hour
What I did in the version upgrade from Ruby 2.5.2 to 2.7.1
Rails engineer environment construction ruby2.7.1
Rails environment construction Rails5.2.1 ruby2.5.1 Catalina
Introduction to Metabase ~ Environment Construction ~
Update Ruby in Unicorn environment
Update RVM on AWS Cloud9
Offline environment construction Ruby edition
[Super easy] Ruby environment construction
AWS ☆☆☆☆ The Road to Deployment 4-Final Chapter (Short Version, All 4 Times)
Ruby on Rails --From environment construction to simple application development on WSL2
How to build Rails + Vue + MySQL environment with Docker [2020/09 latest version]
[Rails] How to reset the database in production environment (Capistrano version)
[Note] Update to production environment [heroku]
Ruby on Rails 6.0 environment construction memo
[Note] Update to production environment (heroku)
[Rails] AWS EC2 instance environment construction
How to build an environment for any version of Ruby using rbenv
I had to lower the PHP version in Docker + Composer + Laravel environment
A story about sending a pull request to MinGW to update the libgr version