LoginSignup
0
0

More than 5 years have passed since last update.

CentOS 6.xでrbenvを設置する。

Last updated at Posted at 2016-02-16

環境

vagrant上のCentOS 6.7

設置

githubからチェックアウトする。

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

環境変数を追加する。

  echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile

初期化する。

  . ~/.bash_profile
  # rbenvコマンドを確認
  which rbenv
  # 初期化
  rbenv init

アップグレード

  • 最新バージョンの場合
  cd ~/.rbenv
  git pull
  • 特定バージョンの場合
  cd ~/.rbenv
  git fetch
  git checkout v0.9.0

ruby-buildをチェックアウトする。

  • rubyを設置するために必要
  • rbenvのpluginとstandaloneで設置できるが、rbenvのpluginとして設置することを推奨する。
  • アップグレードするときはrbenvと同じく設置されたディレクトリへ移動してgit pullする。
  git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build

参考

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