Help us understand the problem. What is going on with this article?

rbenv を使って ruby をインストールする(CentOS編)

More than 5 years have passed since last update.

1. git が入っていなかったらインストール

$ sudo yum -y install git

2. rbenv をインストール(clone)する

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

3. 環境設定

# PATH に追加
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

# .bash_profile に追加
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

# 上記設定の再読み込み
$ exec $SHELL -l

4. rbenvの確認

$ rbenv --version
rbenv 0.4.0-74-g95a039a

5. ruby-build を インストール(clone)する

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

6. ruby の最新版を確認

install -- list でインストール可能なバージョン一覧が出力される

$ rbenv install --list
Available versions:
  1.8.6-p383
  1.8.6-p420
  1.8.7-p249
   :
   :
  2.0.0-p195
  2.0.0-p247
  2.0.0-p353       ← こいつが2.0系の最新版っぽい      
  2.0.0-preview1
  :

7. ruby のインストール

先ほど調べたバージョンを指定する

$ rbenv install -v 2.0.0-p353

8. 環境確認

再読み込み

$ rbenv rehash

インストールされているruby一覧を確認

$ rbenv versions
* system (set by /home/vagrant/.rbenv/version)
  2.0.0-p353

先ほどインストールした最新版に設定

$ rbenv global 2.0.0-p353

確認

$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]

おしまい。

mercari
フリマアプリ「メルカリ」を、グローバルで開発しています。
https://tech.mercari.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした