【发布时间】:2020-11-20 23:32:11
【问题描述】:
我正在运行在带有 macOS Catalina(版本 10.15.7)的新 Macbook 上安装 Ruby 2.0.0 的问题。起初我用 rvm 安装了 Ruby,但它不起作用。我发现这是因为 Catalina 的默认终端是 ZSH 而不是 Bash (https://gorails.com/setup/osx/10.15-catalina)。我能够按照说明安装 Ruby 2.6.3,但问题是我目前正在处理的项目是用 Ruby 2.0.0 编写的。我尝试使用rbenv install 2.0.0-p0 安装此版本,但遇到以下错误:
ruby-build: using libyaml from homebrew
Downloading openssl-1.0.2u.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
Installing openssl-1.0.2u...
Installed openssl-1.0.2u to /Users/vydoan/.rbenv/versions/2.0.0-p0
Downloading ruby-2.0.0-p0.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.bz2
Installing ruby-2.0.0-p0...
WARNING: ruby-2.0.0-p0 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20201005)
Inspect or clean up the working tree at /var/folders/m4/3k5xfdwx7x7gqkzzlyrlc_gc0000gn/T/ruby-build.20201006082731.4615.0q3Cat
Results logged to /var/folders/m4/3k5xfdwx7x7gqkzzlyrlc_gc0000gn/T/ruby-build.20201006082731.4615.log
Last 10 log lines:
compiling cont.c
compiling ./enc/ascii.c
thread.c:928:27: error: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Werror,-Wshorten-64-to-32]
tp->tv_usec = ts.tv_nsec / 1000;
~ ~~~~~~~~~~~^~~~~~
compiling ./enc/us_ascii.c
1 error generated.
make: *** [thread.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.
我已尝试执行以下操作:
1.
brew tap homebrew/dupes
这给了我这个错误日志
Error: homebrew/dupes was deprecated. This tap is now empty and all its contents were either deleted or migrated.
brew install gcc
rbenv install 2.0.0-p0
这给了我与上面相同的错误。
我询问了我的团队,发现另一个人在他们的新 mac 机器上安装 ruby 也有问题。较旧的mac没有这个问题。有人能在较新的 mac 上成功安装 Ruby 2.0.0 吗?
【问题讨论】:
-
FWIW,ZSH 应该可以在 RVM 上正常工作。我刚刚使用 RVM 和 ZSH 在我的机器(Catalina)上安装了 Ruby 2.0.0。
-
github.com/rbenv/ruby-build/issues/1068 在这个帖子中有一些有用的东西可以尝试
-
@weltschmerz 你能扩展一下吗?您运行安装 2.0.0 的脚本是什么?我再次尝试使用 rvm 并收到此错误
Error running '__rvm_make -j12', -
我刚刚跑了
rvm install 2.0.0。尝试更新您的 rvmrvm get head然后再试一次? -
更新后可能需要运行
rvm reload。
标签: ruby-on-rails ruby macos