LoginSignup
2
1

More than 3 years have passed since last update.

asdf で Ruby 3.0.0 をインストールする

Last updated at Posted at 2020-12-29

Ruby 3.0.0 がリリースされたので、早速 asdf でインストールしてみます。

前提

asdf をすでに導入している状態を前提とします。

asdf-ruby プラグインを追加していない場合は、
以下のコマンドを実行し追加します。

shell
asdf plugin-add ruby https://github.com/asdf-vm/asdf-ruby.git

問題

asdf list-all ruby コマンドを実行してみても、
まだ 3.0.0-rc1 までしかリストされていないようです。
(2020/12/26時点)

shell
..
2.7.2
3.0.0-dev
3.0.0-preview1
3.0.0-preview2
3.0.0-rc1
artichoke-dev
jruby-1.5.6
jruby-1.6.3
..

解決

下記コマンドでビルドバージョンを指定してインストールします。

shell
ASDF_RUBY_BUILD_VERSION=v20201225 asdf install ruby 3.0.0

確認

shell
# インストールを確認
asdf list ruby
  3.0.0

# グローバルに指定 & shim 再生成
asdf global ruby 3.0.0
asdf reshim ruby


# シェル再起動 or リロード

# バージョン確認
ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]

# 実体の確認
where ruby
/Users/username/.asdf/shims/ruby

asdf which ruby
/Users/username/.asdf/installs/ruby/3.0.0/bin/ruby

無事インストールできました:cat2:


Source:
https://github.com/asdf-vm/asdf-ruby
https://github.com/asdf-vm/asdf-ruby/pull/192
https://asdf-vm.com/#/core-commands

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