LoginSignup
1
0

asdfでWSL+UbuntuにRubyをインストール

Posted at

はじめに

プログラミング言語管理ツールのasdfを使って、WSL UbuntuにGoをインストールします。

前提環境

#asdf更新

Ubuntu
asdf update

Rubyの存在確認

Ubuntu
asdf plugin list all | grep -e ruby
# ruby                          https://github.com/asdf-vm/asdf-ruby.git

asdfにRubyを追加

Ubuntu
asdf plugin add ruby

依存パッケージをインストール

GithubのREADMEに従い依存パッケージをインストールします。(「Ubuntu/Debian/Mint」項を確認のこと)

Ubuntu
sudo apt install autoconf patch build-essential rustc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev

最新版Rubyをインストール

Ubuntu
asdf install ruby latest

# asdf: Warn: You have configured asdf to preserve downloaded files (with always_keep_download=yes or --keep-download). But
# asdf: Warn: the current plugin (ruby) does not support that. Downloaded files will not be preserved.

# https://github.com/asdf-vm/asdf-ruby/issues/384

警告が出ましたが、気に留めておきひとまず進める。

最新版Rubyをグローバルに設定

Ubuntu
asdf global ruby latest

Rubyバージョン確認

Ubuntu
asdf current ruby
# ruby            3.3.0           /home/[user]/.tool-versions

ruby -v
# ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux]

gem -v
# 3.5.3
1
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
1
0