0
0

More than 1 year has passed since last update.

rbenvでRubyのバージョン切り替えをする方法

Last updated at Posted at 2022-08-20

概要

以下の記事を参考に勉強を進めており、Rubyのバージョンを指定する必要があったため、rbenvでバージョン切り替えてみました。

方法

rbenvのインストール

brew install rbenv ruby-build

rbenvのインストール確認

rbenv -v

ruby 2.6.6のインストール

rbenv install 2.6.6

ruby 2.6.6のローカル使用指定

rbenv local 2.6.6

bash_profileを開く

vi ~/.bash_profile

以下を追加

eval "$(rbenv init -)"

設定を反映

source ~/.bash_profile

rubyのバージョン確認

ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin20]

参考

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