LoginSignup
0
0

More than 5 years have passed since last update.

rbenvを用いたRubyのバージョン管理

Posted at

Ubuntu14.04にrbenvを導入しRubyのバージョン管理をできるようにする方法

1. rbenvとruby-buildをダウンロード

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
apt-get install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev

2. パスを通す

.bashrcに追記

.bashrc
[[ -d ~/.rbenv  ]] && \
  export PATH=${HOME}/.rbenv/bin:${PATH} && \
  eval "$(rbenv init -)"

3. rbenvを用いてRubyのインストール

rbenv install -l
rbenv install 2.x.x  #リストからインストールしたいものを選択
rbenv global 2.x.x  #使いたいバージョンを指定
ruby -v

詳細は以下を参照

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