# cd /usr/local
# git clone https://github.com/sstephenson/rbenv.git
Initialized empty Git repository in /usr/local/rbenv/.git/ remote: Counting objects: 1456, done. remote: Compressing objects: 100% (556/556), done. remote: Total 1456 (delta 938), reused 1367 (delta 871) Receiving objects: 100% (1456/1456), 209.95 KiB | 182 KiB/s, done. Resolving deltas: 100% (938/938), done.
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
Initialized empty Git repository in /usr/local/src/ruby-build/.git/ remote: Counting objects: 1645, done. remote: Compressing objects: 100% (743/743), done. remote: Total 1645 (delta 886), reused 1487 (delta 739) Receiving objects: 100% (1645/1645), 183.65 KiB | 150 KiB/s, done. Resolving deltas: 100% (886/886), done.
# cd ruby-build/
# ./install.sh
Installed ruby-build at /usr/local
# vi /etc/profile.d/rbenv.sh
export RBENV_ROOT="/usr/local/rbenv" export PATH="/usr/local/rbenv/bin:$PATH" eval "$(rbenv init -)"
# chmod 755 /etc/profile.d/rbenv.sh
# visudo
Defaults env_reset Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS" Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE" Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES" Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE" Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY" Defaults env_keep += "PATH" ← 追記する
# rbenv install -l
Available versions: 1.8.6-p383 1.8.6-p420 1.8.7-p249 1.8.7-p302 1.8.7-p334 1.8.7-p352 1.8.7-p357 1.8.7-p358 1.8.7-p370 1.8.7-p371 1.9.1-p378 1.9.2-p180 1.9.2-p290 1.9.2-p318 1.9.2-p320 1.9.3-dev 1.9.3-p0 1.9.3-p125 1.9.3-p194 1.9.3-p286 1.9.3-p327 1.9.3-p362 1.9.3-p374 1.9.3-p385 1.9.3-preview1 1.9.3-rc1 2.0.0-dev 2.0.0-preview1 2.0.0-preview2 2.0.0-rc1 2.0.0-rc2 jruby-1.5.6 jruby-1.6.3 jruby-1.6.4 jruby-1.6.5 jruby-1.6.5.1 jruby-1.6.6 jruby-1.6.7 jruby-1.6.7.2 jruby-1.6.8 jruby-1.7.0 jruby-1.7.0-preview1 jruby-1.7.0-preview2 jruby-1.7.0-rc1 jruby-1.7.0-rc2 jruby-1.7.1 jruby-1.7.2 maglev-1.0.0 maglev-1.1.0-dev rbx-1.2.4 rbx-2.0.0-dev rbx-2.0.0-rc1 ree-1.8.6-2009.06 ree-1.8.7-2009.09 ree-1.8.7-2009.10 ree-1.8.7-2010.01 ree-1.8.7-2010.02 ree-1.8.7-2011.03 ree-1.8.7-2011.12 ree-1.8.7-2012.01 ree-1.8.7-2012.02
# rbenv install 1.9.3-p385
Downloading yaml-0.1.4.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b Installing yaml-0.1.4... Installed yaml-0.1.4 to /usr/local/rbenv/versions/1.9.3-p385 Downloading ruby-1.9.3-p385.tar.gz... -> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p385.tar.gz Installing ruby-1.9.3-p385... Installed ruby-1.9.3-p385 to /usr/local/rbenv/versions/1.9.3-p385
# rbenv global 1.9.3-p385
# rbenv rehash
# ruby -v
ruby 1.9.3p385 (2013-02-06 revision 39114) [x86_64-linux]
最新コメント