5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

rbenvでruby3.2.2をインストールするとBUILD FAILEDになる

Last updated at Posted at 2023-04-02

rbenvでruby3.2.2をインストールしようとしたら、BUIDL FAILEDが発生しました。

環境

macOS 12.1(Monterey)

成功するコマンド

一旦、システム直下にruby3.2.2をインストールする。

brew install ruby

こうすることで、ruby3.2.2に必要な依存関係が整備される(執筆当時はruby3.2.2が最新なので自動的に対象のバージョンがインストールされるが、本来はbrew install ruby@3.2.2のような指定が必要かもしれない)。

続いて、先ほど入れたrubyは不要なので削除する。

brew uninstall ruby

最後に、rbenvでruby3.2.2をインストール。

rbenv install 3.2.2

こちらで成功しました。

(参考)最初に出たエラー文

❯ rbenv install 3.2.2
To follow progress, use 'tail -f /var/folders/vp/l949bc451wd16xjszv_qvnsr0000gn/T/ruby-build.20230402152243.50133.log' or pass --verbose
Downloading openssl-3.1.0.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/aaa925ad9828745c4cad9d9efeb273deca820f2cdcf2c3ac7d7c1212b7c497b4
Installing openssl-3.1.0...
Installed openssl-3.1.0 to /Users/***/.rbenv/versions/3.2.2

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...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.1 using ruby-build 20230330)

Inspect or clean up the working tree at /var/folders/vp/l949bc451wd16xjszv_qvnsr0000gn/T/ruby-build.20230402152243.50133.R8PbbK
Results logged to /var/folders/vp/l949bc451wd16xjszv_qvnsr0000gn/T/ruby-build.20230402152243.50133.log

Last 10 log lines:
	Check ext/psych/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
Generating RDoc documentation
/private/var/folders/vp/l949bc451wd16xjszv_qvnsr0000gn/T/ruby-build.20230402152243.50133.R8PbbK/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
make: *** [rdoc] Error 1

よくわからないけど動いたからヨシ!

参考にした記事

5
3
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
5
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?