LoginSignup
6
6

More than 5 years have passed since last update.

Installing rbenv and ruby 2.1.2 onto Ubuntu 14.04 LTS

Posted at

so forgettable me, just write down. thanks.

~/  $  sudo apt-get install build-essential git curl zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev sqlite3 libsqlite3-dev nodejs tk
 :

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

~/  $  git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-buildom
 :
※ i can't treat rbenv-gemset in rubymine, so i don't install it (but i want it :P

~/  $ vi .bashrc
 :
 :
# ruby 
export RBENV_ROOT=$HOME/.rbenv 
export PATH=$RBENV_ROOT/bin:$PATH 
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi 

# git
git_branch() { 
  echo $(git branch --no-color 2>/dev/null | sed -ne "s/^\* \(.*\)$/\1/p") 
} 
export PS1='\[\033[0;33m\]\W/ \[\033[1;32m\]$(git_branch)\[\033[0m\] $ '

~/  $ . .bashrc
~/  $ env|grep PATH
 :
PATH=/home/sato1043/.rbenv/shims:/home/sato1043/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
 :

~/  $ rbenv
rbenv 0.4.0-98-g13a474c
Usage: rbenv <command> [<args>]
 :

~/  $ rbenv versions
* system (set by /home/sato1043/.rbenv/version)

~/  $ ruby -v
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]  (※aptの依存性で入ったruby)

~/  $ rbenv install 2.1.2
Downloading ruby-2.1.2.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635
Installing ruby-2.1.2...
Installed ruby-2.1.2 to /home/sato1043/.rbenv/versions/2.1.2

~/  $ rbenv versions
* system (set by /home/sato1043/.rbenv/version)
  2.1.2

~/  $ rbenv global 2.1.2

~/  $ rbenv versions
  system
* 2.1.2 (set by /home/sato1043/.rbenv/version)

~/  $ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

~/  $ gem install rbenv-rehash
 :
1 gem installed

~/  $ gem install bundler
 :
1 gem installed

now i cant use ruby 2.1.2 by rbenv.

6
6
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
6
6