0

我正在尝试ruby 2.6.4通过rbenv安装macOS Mojave

rbenv install 2.6.4

但每次我尝试它都会给我:

ruby-build: using openssl from homebrew
Downloading ruby-2.6.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.4.tar.bz2
Installing ruby-2.6.4...
ruby-build: using readline from homebrew

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

Inspect or clean up the working tree at /var/folders/tc/ctlyg05n4czbm9wb3vvm11xr0000gn/T/ruby-build.20190920102949.80278
Results logged to /var/folders/tc/ctlyg05n4czbm9wb3vvm11xr0000gn/T/ruby-build.20190920102949.80278.log

Last 10 log lines:
tool/config.guess already exists
tool/config.sub already exists
checking build system type... x86_64-apple-darwin18.7.0
checking host system type... x86_64-apple-darwin18.7.0
checking target system type... x86_64-apple-darwin18.7.0
checking whether the C compiler works... no
configure: error: in '/var/folders/tc/ctlyg05n4czbm9wb3vvm11xr0000gn/T/ruby-build.20190920102949.80278/ruby-2.6.4':
configure: error: C compiler cannot create executables
See 'config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

到目前为止尝试过的解决方案:

1)xcode-select --install

2)在xcode中添加缺少的包 open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

3)重新安装rbenvruby-build通过homebrew和直接

4)RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.6.4

sudo rbenv install 2.6.4可以,但我希望它不安装,sudo因为它在安装导轨时会导致其他并发症。

有谁知道这个问题的解决方案?

4

1 回答 1

0

关于这个问题有一个问题。此评论的解决方案:

我通过在 Xcode > Preferences > Locations 中选择 Command Line Tools 解决了这个问题

你试过这种方法吗?

于 2019-09-20T07:55:07.007 回答