我正在尝试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)重新安装rbenv
并ruby-build
通过homebrew
和直接
4)RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.6.4
sudo rbenv install 2.6.4
可以,但我希望它不安装,sudo
因为它在安装导轨时会导致其他并发症。
有谁知道这个问题的解决方案?