LoginSignup
3
3

More than 5 years have passed since last update.

ruby install CentOS Ubuntu

Last updated at Posted at 2017-05-16

rubyのインストール方法備忘録

rbenvを使用したrubyのインストールメモ

CentOS

rbenvはgithubからとってくるためgitをインストールする

sudo yum -y install git

rbenvをcloneしてくる

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv

pathを通す

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile

ruby-buildをインストールする

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

rubyのインストールに必要なものをインストールする

sudo yum install bzip2 gcc-c++ openssl-devel readline-devel zlib-devel

rubyのバージョンを確認

rbenv install --list

rubyをインストール

rbenv install -v x.x.x(先ほど確認したバージョン)

確認

rbenv rehash
rbenv versions  #インストールされているrubyのバージョンを確認できる

使用するrubyのバージョンを設定

rbenv global x.x.x

確認

ruby -v

設定したバージョンになっていれば成功

Ubuntu

yum -> apt-get

以上

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3