Today, I encountered an issue while installing Ruby with asdf on Windows using WSL. When attempting to run gem install <extension>
, I received the following error:
<internal:/home/<user>/.asdf/installs/ruby/3.3.0/lib/ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:127:in `require': cannot load such file -- zlib (LoadError)
After an extensive search, the solution that worked for me was to install the following packages:
sudo apt-get install libffi-dev libncurses-dev libbz2-dev libssl-dev libreadline-dev libsqlite3-dev zlib1g-dev
Following this, I reinstalled the Ruby:
asdf uninstall ruby <version>
asdf install ruby <version>
After that, I was able to execute the gem install
command.
Top comments (0)