ruby 在Apple M1 mac上安装rvm 2.6.7总是失败

wr98u20j  于 2022-11-04  发布在  Ruby
关注(0)|答案(4)|浏览(728)

我总是在我的M1 mac上得到below错误,而rvm install 2.6.7

me@xx ~ % rvm install 2.6.7
ruby-2.6.7 - #removing src/ruby-2.6.7 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/11.5/x86_64/ruby-2.6.7.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/me/.rvm/rubies/ruby-2.6.7, this may take a while depending on your cpu(s)...
ruby-2.6.7 - #downloading ruby-2.6.7, this may take a while depending on your connection...
ruby-2.6.7 - #extracting ruby-2.6.7 to /Users/me/.rvm/src/ruby-2.6.7 - please wait
ruby-2.6.7 - #configuring - please wait
ruby-2.6.7 - #post-configuration - please wait
ruby-2.6.7 - #compiling - please wait
Error running '__rvm_make -j8',
please read /Users/me/.rvm/log/1629787822_ruby-2.6.7/make.log

There has been an error while running make. Halting the installation.
kt06eoxx

kt06eoxx1#

是的,这是上游的已知问题:https://bugs.ruby-lang.org/issues/17777 ruby-build也在跟踪此问题:https://github.com/rbenv/ruby-build/issues/1489
解决方法是运行以下代码,然后再次安装ruby 2.6.7:

$ export warnflags=-Wno-error=implicit-function-declaration
$ rbenv install 2.6.7
  • 或-
$ CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.6.7

看起来这也会影响带有本地扩展的gem安装(mysql 2就是其中之一):

gem install <GEMNAME> -- --with-cflags="-Wno-error=implicit-function-declaration"

参考:Error installing ruby 2.6.7 on mac os - how to resolve?

q0qdq0h2

q0qdq0h22#

我在RVM中遇到了同样的问题,以下解决方案对我有效。

CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.6.0
elcex8rz

elcex8rz3#

我也遇到过同样的问题,最简单的办法就是安装2.6.9以后的版本,一切都会好起来的。
如果你真的需要旧版本的ruby,你可以尝试使用openssl@1.0.如果它仍然是错误的.也许看到这个博客在这里输入链接描述,它没有使用arm one.

j2qf4p5b

j2qf4p5b4#

请检查一下这个,它对我有效。

brew install openssl
rvm install 2.6.7 --with-openssl-dir=/usr/local/opt/openssl

相关问题