LoginSignup
2
2

More than 5 years have passed since last update.

rbenvを使ったrubyインストール方法

Posted at

依存パッケージをインストール

sudo yum -y --enablerepo=remi,epel  install libyaml libyaml-devel zlib zlib-devel readline readline-devel openssl openssl-devel libxml2 libxml2-devel libxslt libxslt-devel

rbenvをインストール

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

環境設定

以下の2行を.bashrcに記述

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

.bashrc読み込み

$ source ~/.bashrc

ruby-buildをインストール

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

rubyのインストール

インストール可能なrubyのバージョンを確認

$ rbenv install --list 

rubyのインストール

$ rbenv install -v 2.1.2

rubyのバージョンを変更

$ rbenv rehash
$ rbenv versions
$ rbenv global 2.1.2
2
2
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
2
2