簡體   English   中英

使用 rbenv 在 MacOS 上安裝 Ruby 2.6.0 失敗

[英]Ruby 2.6.0 installation fails on MacOS with rbenv

我在 Mojave 上有一台 Mac,但它無法安裝開發所需的一些基本東西:

$ rbenv install 2.6.0

Downloading openssl-1.1.1d.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
Installing openssl-1.1.1d...

BUILD FAILED (OS X 10.14.6 using ruby-build 20191223)

Inspect or clean up the working tree at /var/folders/l_/xgbzwc3j0xn_cb74550m71vr0000gn/T/ruby-build.20191225225406.18503.lq8QNM
Results logged to /var/folders/l_/xgbzwc3j0xn_cb74550m71vr0000gn/T/ruby-build.20191225225406.18503.log

Last 10 log lines:
      _s_server_main in s_server.o
  "_verify_stateless_cookie_callback", referenced from:
      _s_server_main in s_server.o
  "_wait_for_async", referenced from:
      _s_client_main in s_client.o
      _sv_body in s_server.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [apps/openssl] Error 1
make: *** [all] Error 2

我發現幾篇博文都在談論 Mojave 版本如何為開發人員帶來一些麻煩,但沒有一篇文章提供解決方案。 有沒有其他人遇到過上述問題?

另一個線程重新發布我的回復 - 我遇到了類似的問題,可以推薦以下與需要先卸載ed 的binutils相關的方法。 什么對我有用:

brew uninstall binutils
# Uninstalling /usr/local/Cellar/binutils/2.33.1... (134 files, 167.6MB)

rbenv install 2.6.5 && rbenv local 2.6.5 ;
# Downloading openssl-1.1.1d.tar.gz...
# -> https://dqw8nmjcqpjn7.cloudfront.net/1e3a91bc1f9dfce01af26026f856e064eab4c8ee0a8f457b5ae30b40b8b711f2
# Installing openssl-1.1.1d...
# Installed openssl-1.1.1d to /Users/auser/.rbenv/versions/2.6.5

# Downloading ruby-2.6.5.tar.bz2...
# -> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.bz2
# Installing ruby-2.6.5...
# ruby-build: using readline from homebrew
# Installed ruby-2.6.5 to /Users/auser/.rbenv/versions/2.6.5

在此之前,我還在ruby-build.log 中收到了許多不同的消息 - 最后一條是:

# ld: symbol(s) not found for architecture x86_64

我在自制軟件設置(卸載之前)中采取的許多其他步驟包括:

brew install perl ruby rbenv
# // UPDATE PATHs with suggestions made by brew during install
which awk perl
# /usr/local/bin/awk
# /usr/local/bin/perl
# ^^^ IN SHORT ALL PATHs should be with /usr/local/opt OR /usr/local/bin

您可以根據需要再次重新安裝 binutils,並記住使用您可能重新執行的任何未來rbenv install版本重復卸載(自我注意)。

PS - 在 macOS Catalina 10.15.3 (19D76) 上測試成功安裝 2.4.0 和 2.6.5

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM