LoginSignup
3
3

More than 5 years have passed since last update.

Rubyインストール手順

Posted at

Homebrewでrbenvをインストール

下記コマンドを実行する

$ brew update
$ brew install readline ruby-build rbenv

Pathの設定をする

~/.zshrcまたは~/.bash_profileの使っている方のファイルに下記のpath設定を行う

export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"

設定後下記コマンドを実行しpathを有効化する

$ source ~/.zshrc or ~/.bash_profile

rbenvを使いrubyをインストールする

インストール可能なRubyのバージョンを確認する

$ rbenv install -l

インストールしたいversionを指定しRubyをインストールする

$ rbenv install インストールしたいversion

インストール完了後、使用できるversion一覧を確認する

$ rbenv versions

先ほどインストールしたversionを指定し下記コマンドを実行する

$ rbenv global インストールしたversion

最後に下記コマンド実行し指定のversionが反映されていればOK

$ ruby --version
3
3
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
3
3