10
8

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.

rbenvでRubyのversion を変更する方法

Posted at

作成するアプリ単位でrubyのバージョンを変更することに最初はなれずにErrorが出ていたので、自分用のメモとして記録しておきます。

現状のversion確認

$ rbenv version
2.5.0 (set by /Users/name/.rbenv/version)

installできるバージョンの確認

$ rbenv install -l
Available versions:
(略)
 2.4.0-dev
  2.4.0-preview1
  2.4.0-preview
  2.4.0-preview3
  2.4.0-rc1
  2.4.0
  2.4.1
  2.4.2
  2.4.3
  2.4.4
  2.5.0-dev
  2.5.0-preview1
  2.5.0-rc1
  2.5.0
  2.5.1
  2.6.0-dev
  2.6.0-preview1
  2.6.0-preview2

バージョン変更

$ rbenv install 2.x.x

installしたバージョンの適用

指定したディレクトリで適用する場合

$ cd
$ mkdir hoge 
$ rbenv local 2.x.x
$ rbenv version
2.x.x (set by /home/user/hoge/.ruby-version)

環境全体で適用する場合

$ rbenv global 2.x.x
$ rbenv version
2.x.x (set by /home/user/hoge/.ruby-version)

参考サイト

10
8
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
10
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?