LoginSignup
32
33

More than 5 years have passed since last update.

[CentOS]ruby-build,rbenvのインストール方法

Last updated at Posted at 2013-03-20

導入準備

gitが必要になるのでインストールします。

gitinstall
sudo yum install git


ruby-buildのインストール

ruby-buildはrubyをビルドするためのツールになります。

github ruby-build
インストール方法は上記のサイト、READMEに書いてありますのでそちらを参照するほうがより正確だと思います。
と言ってもそのままなんですが‥

ruby-build
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
cd ~/.rbenv/plugins/ruby-build
sudo ./install.sh

gitをcloneするディレクトリは適宜変えてもらって結構だと思います。

rbenvのインストール

rbenvはrubyのバージョンを管理するツールになります。
よく聞くBundlerはgemパッケージを管理するツールになります。(*余計な話)

github rbenv

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

cloneした場所にPATH,rbenvの初期化を追加
bashを使っている方は.bash_profileにzshを使っている方は.zshrcに追記します

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

以上でインストール終了です。
rbenvコマンドが使えるかどうか確認お願いします。

32
33
1

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
32
33