geek-peachの日記

geekを目指してpeachが頑張るブログ。実行したコマンドやデータ分析についてメモっていく

rbenvによるrubyのインストール(コマンドのみ)

rbenvでrubyをインストールするときのメモ。解説はない!

rootで実行すれば他のユーザもruby及びrbenvが使えるようになる。

 

cd /usr/local/src/

rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

vi /etc/yum.repos.d/remi.repo

remiのrepoをenable=1に変更

 

yum -y install tmux git

yum -y install gcc

 

cd /usr/local/

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

mkdir rbenv/shims rbenv/versions

groupadd rbenv

chgrp -R rbenv rbenv/

chmod -R g+rwxXs rbenv/

 

cd /usr/local/src/

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

cd ruby-build/

./install.sh

 

vi /etc/profile.d/rbenv.sh

 

(以下を加える

export RBENV_ROOT="/usr/local/rbenv"

export PATH="/usr/local/rbenv/bin:$PATH"

eval "$(rbenv init -)"

 

visudo

(Defaults    env_keep += "PATH"を加える)

 

rbenv install -l

rbenv install 1.9.3-p392

rbenv global 1.9.3-p392