Ubuntu 20.04. Trying to install Ruby 3.2.2 I get the following error:
/tmp/ruby-build.20230911110842.25159.uzwoaP/ruby-3.2.2/lib/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
So I go on and run:
sudo apt-get update
sudo apt-get install libyaml
But I get the following output:
E: Unable to locate package libyaml
What’s wrong?
2
Answers
Indeed, it seems that there’s no package named
libyaml
on Ubuntu 20.04.Some packages that might possibly solve your dependency:
libyaml-libyaml-perl
(original implementation afaik)libyaml-0-2
(faster C++ implementation)The error message suggests that the package
libyaml
is not available in the Ubuntu repositories, which is why apt-get is unable to locate it. However, the package you’re looking for is actually namedlibyaml-dev
.You can install it using the following command:
After installing
libyaml-dev
, you should reinstall Ruby. If you’re usingrbenv
andruby-build
, you can do this with the following command:This should be it.