Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1でRuby 3.2.0を入れようとするとエラーになる #38

Open
ksbmyk opened this issue Mar 21, 2023 · 3 comments
Open

M1でRuby 3.2.0を入れようとするとエラーになる #38

ksbmyk opened this issue Mar 21, 2023 · 3 comments

Comments

@ksbmyk
Copy link

ksbmyk commented Mar 21, 2023

M1 Monterey 12.6 でRuby 3.2.0 を入れようとするとエラー(3.2.1でも起こる)

2023/03/21 Rails Girls Tokyo 15th コーチ素振り会で発生

$ rbenv install 3.2.0
To follow progress, use 'tail -f /var/folders/r9/t3v189lx7h9d4xrn37n546200000gn/T/ruby-build.20230321193100.4190.log' or pass --verbose
Downloading openssl-3.0.8.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e
Installing openssl-3.0.8...
Installed openssl-3.0.8 to /Users/***/.rbenv/versions/3.2.0

Downloading ruby-3.2.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.0.tar.gz
Installing ruby-3.2.0...
ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.6 using ruby-build 20230309-1-gf3c1ccc)

Inspect or clean up the working tree at /var/folders/r9/t3v189lx7h9d4xrn37n546200000gn/T/ruby-build.20230321193100.4190.L7W777
Results logged to /var/folders/r9/t3v189lx7h9d4xrn37n546200000gn/T/ruby-build.20230321193100.4190.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/r9/t3v189lx7h9d4xrn37n546200000gn/T/ruby-build.20230321193100.4190.L7W777/ruby-3.2.0/lib/yaml.rb:three: 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

$ brew install libyaml をしてから $ rbenv install 3.2.0 すると正常にインストールできました
参考 https://qiita.com/notakaos/items/e3e30443b1e57f84e7d8

@ksbmyk ksbmyk changed the title M1でRuby 3.2.1を入れようとするとエラーになる M1でRuby 3.2.0を入れようとするとエラーになる Mar 21, 2023
@nobu09
Copy link

nobu09 commented Mar 21, 2023

libyaml、Ruby3.2.0から同梱されるの廃止になったようです
https://www.ruby-lang.org/ja/news/2022/12/25/ruby-3-2-0-released/

自分はintel macですが、Ruby3.2.1をインストール中に以下のような出力が出ていました
私は、すでにlibyamlをbrewでinstall済だったようでした
intel Macでもlibyamlのbrew installが必要かもしれないです

Installing ruby-3.2.1...
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew

@ksbmyk
Copy link
Author

ksbmyk commented Mar 21, 2023

libyaml、Ruby3.2.0から同梱されるの廃止になったとのこと
https://www.ruby-lang.org/ja/news/2022/12/25/ruby-3-2-0-released/
(intelMacでlibyamlのbrew installが必要かもしれないとのこと)

Installing ruby-3.2.1...
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew

@hsbt
Copy link
Member

hsbt commented Mar 23, 2023

railsgirls-jp/railsgirls.jp#607https://guides.railsgirls.com/ の内容を確認しているときに気がついたんですが、3.1 を使った方がトラブル避けられるかも知れません。

なお、libyaml は必須なので、手順で brew install を追加したほうが良さそうです。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants