2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rubyのバージョン変更について

2
Last updated at Posted at 2021-07-15

概要

Rubyのバージョンの変更の仕方をお伝えします。

注意

現場では頻繁にバージョンを変えたりしないので、この点は気をつけてください。

rbenvを最新のバージョンに更新

それぞれ見ていきます。

$ rbenv  install --list  #インストールできるバージョンの確認
$ brew upgrade ruby-build #rbenvを最新の状態にする
$ rbenv install 2.7.2  #バージョンを2.7.2に更新する場合
$ rbenv rehash      #インストール完了後に実行
$ rbenv versions    #バージョン確認
$ rbenv local 2.7.2    #バージョンを2.7.2に指定
#rbenv versionsを実行して2.7.2の横に*がついていればOK

簡単なやり方

Railsで開発をしていると.ruby_versionというファイルがあるはずです。
ここを変えたら自動で変わります。

.ruby_version
2.7.1

使わなくなったバージョンの消し方

今回は2.7.1を消します。

rbenv uninstall -f 2.7.1

資料

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?