LoginSignup
0
0

More than 5 years have passed since last update.

rbenvとruby-buildのインストール

Posted at

rbenvと、それのプラグインruby-buildをインストールするには。

Terminal
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

と、上記を実行したあとに、

.bash_profile
rbenv=$HOME/.rbenv/bin
if [ -d "$rbenv" ]
then
  export PATH=$rbenv:$PATH
  eval "$(rbenv init -)"
fi

.bash_profileもしくは.bashrcに書いておけば良い。と、昔書いたメモには書いてある。


……ふと気になったので自分の.bashrcを見たら以下のように書いてた。(.bash_profileは常に.bashrcを読み込むように書いてある)

.bashrc
rbenv=$HOME/.rbenv/bin
[ -d "$rbenv" ] &&
  export PATH=$rbenv:${PATH//$rbenv:/}
type rbenv >/dev/null 2>&1 && eval "$(rbenv init -)"

これはあれかな、$ source $HOME/.bashrcを実行しても再度evalしないようにしてるのかな。

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