1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac OS X(EL Captain)でrbenvからいれたrubyのバージョンが切り替わらない時の対処法

Posted at

適当にググッてrbenvインストールしたがrubyのバージョンが勝手に切り替わってくれなくてちょっと戸惑う。。

% rbenv install 2.3.1
Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
Installing ruby-2.3.1...
Installed ruby-2.3.1 to /Users/MusicThanks/.rbenv/versions/2.3.1

% rbenv versions
* 2.3.1 (set by /Users/hoge/.rbenv/version)

% rbenv global 2.3.1

% ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

.zshrcに下記を入力し

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

読み込ませたら無事解決。

% source .zshrc
% ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

参考

1
1
1

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?