0
0

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.

Ruby3.1.1のインストール(忘備録)

Last updated at Posted at 2022-02-19

エラー内容を載せてなくてすみません。とりあえずの忘備録。

macOS Monterey(12.2.1)
CPUはIntel

$ rbenv install -v 3.1.1

がこける

以下やったこと

これをみるとbinutilsが新しいといいらしい
https://github.com/rbenv/ruby-build/issues/1723

自分は入ってなかったので

$ brew install binutils

とした上で(binutils 2.37が入りました)pathを通す

.zshrcに

export PATH="/usr/local/opt/binutils/bin:$PATH"

を書く

まだダメだった(opensslのビルドでだめ)のでopensslをHomebrewで入れてあるopenssl@1.1の方を使う
参考: https://qiita.com/mikan3rd/items/d1dfd7cb62cc23393dd9

$ export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --with-zlib-dir=$(brew --prefix zlib)"

まだエラーが出るのでさっきのissueを参考にRUBY_CONFIGURE_OPTSにrb_cv_symbol_prefix=_を足してみる
https://github.com/rbenv/ruby-build/issues/1723

$ export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1) --with-readline-dir=$(brew --prefix readline) --with-libyaml-dir=$(brew --prefix libyaml) --with-zlib-dir=$(brew --prefix zlib) rb_cv_symbol_prefix=_"

これでもllvm-arが見つからないというエラーが出るのでこうしてみる

$ export AR=/usr/bin/ar 

これで入った。

追記:

上記で入れたrubyでgrpc gem(1.43.1)が入らない

0
0
1

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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?