前人未踏の領域へ WEB・インフラ・プログラミング全般編

フロントエンド、バックエンド、インフラ、言語など、アプリ開発、IOT以外の記録

rbenv: Ruby3.2インストールエラー

内容

rbenv でruby 3.2.2をインストールしようとしたら以下のエラーが発生した。

$ rbenv install 3.2.2
To follow progress, use 'tail -f /tmp/ruby-build.20231021091520.5507.log' or pass --verbose
Downloading ruby-3.2.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz
Installing ruby-3.2.2...

BUILD FAILED (Ubuntu 18.04 using ruby-build 20230717-11-g4d4678b)

Inspect or clean up the working tree at /tmp/ruby-build.20231021091520.5507.wUPdqj
Results logged to /tmp/ruby-build.20231021091520.5507.log

Last 10 log lines:
make[1]: Leaving directory '/tmp/ruby-build.20231021091520.5507.wUPdqj/ruby-3.2.2'
Generating RDoc documentation
/tmp/ruby-build.20231021091520.5507.wUPdqj/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.
uh-oh! RDoc had a problem:
cannot load such file -- psych

run with --debug for full backtrace
uncommon.mk:597: recipe for target 'rdoc' failed
make: *** [rdoc] Error 1

対応

必要なライブラリをインストール

$ sudo apt install libyaml-dev libffi-dev

参考

mseeeen.msen.jp

/* Responsive: yes */