LoginSignup
0
1

More than 1 year has passed since last update.

M1Macでrbenv installに失敗した時の解決法

Posted at

事象

M1 Macでrbenv install 3.1.2を実行するとビルドエラーが発生した。

$ rbenv install 3.1.2
To follow progress, use 'tail -f /var/folders/8f/kgc0h4dx03s4gb9k8ntpt4bw0000gn/T/ruby-build.20230420224301.42654.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/tokitoukanta/.rbenv/versions/3.1.2

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

BUILD FAILED (macOS 13.1 using ruby-build 20230330)

Inspect or clean up the working tree at /var/folders/8f/kgc0h4dx03s4gb9k8ntpt4bw0000gn/T/ruby-build.20230420224301.42654.0DFwqR
Results logged to /var/folders/8f/kgc0h4dx03s4gb9k8ntpt4bw0000gn/T/ruby-build.20230420224301.42654.log

Last 10 log lines:
compiling ossl_x509ext.c
compiling ossl_x509name.c
compiling ossl_x509req.c
compiling ossl_x509revoked.c
linking shared-object psych.bundle
compiling ossl_x509store.c
3 warnings generated.
linking shared-object openssl.bundle
linking shared-object ripper.bundle
make: *** [build-ext] Error 2

解消方法

logや色々なサイトを見て解決法を試したが、上手くいかず、、、
このサイトを見て下記を実行したら解消した。

$ CFLAGS="-Wno-error=implicit-function-declaration" RUBY_CONFIGURE_OPTS='--with-readline-dir=/usr/local/opt/readline/' arch -x86_64 rbenv install 3.1.2
0
1
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
0
1