AWS is an abbreviation for Amazon Web Servises, which is a cloud server service provided by Amazon. We will output what we have learned in order to improve our understanding of AWS.
Install Ruby on the instance created by EC2 on AWS.
It is assumed that you have created an instance.
① Log in to the instance
Terminal
% ssh -i key pair name.pem ec2-user@<Public IP>
(2) Install the packages required to build the environment While logged in to the instance
Terminal
First, update the package.
[instance]$ sudo yum -y update
Install the package.
[instance]$ sudo yum -y install git make gcc-c++ patch libicu-devel readline-devel libxml2-devel libxslt-devel ImageMagick ImageMagick-devel openssl-devel libcurl-devel curl
③ Install Node.js (so that JavaScript can run)
Terminal
[instance]$ sudo curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
[instance]$ sudo yum install -y nodejs
③ Install Yarn (package manager for managing JavaScript packages)
Terminal
[instance]$ sudo yum install -y wget
[instance]$ sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo
[instance]$ sudo yum install -y yarn
④ Install rbenv and ruby-build rbenv: A tool that switches Ruby versions ruby-build: A rbenv plugin that provides the rbenv install command for compiling and installing different versions of Ruby on UNIX-like systems.
Install rbenv
[instance]$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
Pass through
[instance]$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
[instance]$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
.bash_Load profile
[instance]$ source .bash_profile
ruby-install build
[instance]git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rehash(Make commands available)
[instance]$ rbenv rehash
⑤ Install Ruby
Ruby 2.6.Install 5
[instance]$ rbenv install 2.6.5
Specify the version of Ruby to use in the instance
[instance]$ rbenv global 2.6.5
rehash(Make commands available)
[instance]$ rbenv rehash
We hope that this post will help beginners review.
Recommended Posts