I'm trying to install ruby 2.6.4
via rbenv
on macOS Mojave
rbenv install 2.6.4
But every time I try it gives me:
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.
Tried solutions so far:
1) xcode-select --install
2) Add missing packages in xcode
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
3) Reinstall rbenv
and ruby-build
via homebrew
and direct
4) RUBY_CONFIGURE_OPTS=--with-readline-dir="$(brew --prefix readline)" rbenv install 2.6.4
sudo rbenv install 2.6.4
works but I want it to install without sudo
because it leads to other complications when installing rails.
Does anyone know a solution to this issue?