LoginSignup
4
4

More than 5 years have passed since last update.

システムのRubyではなく、rbenvのRubyに変更するTips

Last updated at Posted at 2015-03-21

初めに

内容はよくある記事ですが、
タイトルから探しやすいように、記事にしました。
(備忘録として)

内容

Rubyを実行する場合、システムのRubyになっていて、
rbenvのRubyに変更したい/使いたい場合のちょっとした記事です。

対象ファイル

zshの場合
vi ~/.zshrc
bashの場合
vi ~/.bash_profile

変更点

末尾にこれを追加
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

環境変数の反映

zshの場合
source ~/.zshrc
bashの場合
source ~/.bash_profile

シェルの再起動でもいいです。
上のコマンドを打つとすぐに反映されます。

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