$ rbenv install
Downloading openssl-1.1.1f.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35
Installing openssl-1.1.1f...
Installed openssl-1.1.1f to /Users/olivierlacan/.rbenv/versions/2.7.1
Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...
ruby-build: using readline from homebrew
BUILD FAILED (OS X 10.14.6 using ruby-build 20200401-2-g504f6e6)
Inspect or clean up the working tree at /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20200402020612.96462.de6XSY
Results logged to /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20200402020612.96462.log
Last 10 log lines:
int sigvec(int, struct sigvec *, struct sigvec *);
^
_Nullable
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:106:48: note: insert '_Nonnull' if the pointer should never be null
int sigvec(int, struct sigvec *, struct sigvec *);
^
_Nonnull
189 warnings generated.
215 warnings generated.
189 warnings generated.
The build log is gigantic so I won't put it here unless someone requests it zipped.
I had this install work fine on 10.15 Catalina earlier today so something is specifically problematic with either Mojave or the specific Xcode/CommandLineTools SDK here. Or maybe it's my Homebrew-installed openssl (1.1.1d) and readline for which I believe I have appropriate flags:
export PATH="$(brew --prefix openssl)/bin:$PATH"
export LDFLAGS="-L$(brew --prefix openssl)/lib"
export CPPFLAGS="-I$(brew --prefix openssl)/include"
export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig"
export CFLAGS="-I$(xcrun --show-sdk-path)/usr/include"
export CFLAGS="-I$(brew --prefix readline)/include $CFLAGS"
export LDFLAGS="-L$(brew --prefix readline)/lib $LDFLAGS"
export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
Hi, @olivierlacan, sorry you're having issues.
You may paste the whole log as a gist and link it here. I think the lines shown here are only some kind of non-fatal warnings. I can't tell what is the actual error.
To link to Homebrew openssl and readline you only need this:
RUBY_CONFIG_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" rbenv install
You shouldn't need to set any other environment variables.
Interestingly the whole log file crashed chrome when I tried to Gist it so I鈥檒l try again tomorrow. Am I wrong to assume that although I have OpenSSL 1.1.1d locally this shouldn鈥檛 have an effect on ruby-build since it bundles its own OpenSSL?
@olivierlacan You can create a gist from the command line using a tool like hub: hub gist create -c myfile.log (the gist URL will now be on the clipboard)
Am I wrong to assume that although I have OpenSSL 1.1.1d locally this shouldn鈥檛 have an effect on ruby-build since it bundles its own OpenSSL?
Yes, every ruby-build installation on macOS bundles its own OpenSSL since the system one is broken. However, to speed installations up and to have a central upgradeable OpenSSL, people often explicitly link against Homebrew openssl via the --with-openssl-dir flag. Also, using Homebrew openssl might help people avoid build issues with the bundled OpenSSL (but it doesn't look like it was the OpenSSL build that failed for you).
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])" rbenv install
and everything is fine
@olivierlacan You can create a gist from the command line using a tool like hub:
hub gist create -c myfile.log(the gist URL will now be on the clipboard)
@mislav No dice, the file is too big and leads to a server error even from hub:
$ git gist create -c /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20200403030515.44193.log
Error creating gist: Bad Gateway (HTTP 502)
Server Error
So I zipped it up down to 6.9 MB from 153 MB: http://link.olivierlacan.com/3a075a45e7c1
I'm seeing a lot of warnings but the only clear error seems to be:
compile.c:9858:63: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
rb_bug("%s: index (%d) mismatch (expect %s but %s).", RUBY_FUNCTION_NAME_STRING, i, name, table[i].name);
I had this issue and, using the same export flags as @olivierlacan original post, I was eventually able to get 2.6.5 built with asdf.
I figured this out. I had a flag export that was overriding instead of appending flags (which is problematic because Homebrew seems to encourage overriding flag by only showing a simple export command) which led to rbenv detecting OpenSSL but not being able to link to it (I think...) and more importantly I had xcrun pointing to CLI Tools SDK headers for the wrong version of macOS somehow. xcrun can print the directory it has selected for headers and I remember finding that on some Python GitHub issues somewhere but I鈥檓 not on my main machine right now so you might be able to look it up.
$ rbenv install Downloading openssl-1.1.1f.tar.gz... -> https://dqw8nmjcqpjn7.cloudfront.net/186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35 Installing openssl-1.1.1f... Installed openssl-1.1.1f to /Users/olivierlacan/.rbenv/versions/2.7.1 Downloading ruby-2.7.1.tar.bz2... -> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2 Installing ruby-2.7.1... ruby-build: using readline from homebrew BUILD FAILED (OS X 10.14.6 using ruby-build 20200401-2-g504f6e6) Inspect or clean up the working tree at /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20200402020612.96462.de6XSY Results logged to /var/folders/0t/hft4_1h13wqd91mwcw2j94h80000gn/T/ruby-build.20200402020612.96462.log Last 10 log lines: int sigvec(int, struct sigvec *, struct sigvec *); ^ _Nullable /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/signal.h:106:48: note: insert '_Nonnull' if the pointer should never be null int sigvec(int, struct sigvec *, struct sigvec *); ^ _Nonnull 189 warnings generated. 215 warnings generated. 189 warnings generated.The build log is gigantic so I won't put it here unless someone requests it zipped.
I had this install work fine on 10.15 Catalina earlier today so something is specifically problematic with either Mojave or the specific Xcode/CommandLineTools SDK here. Or maybe it's my Homebrew-installed openssl (1.1.1d) and readline for which I believe I have appropriate flags:
export PATH="$(brew --prefix openssl)/bin:$PATH" export LDFLAGS="-L$(brew --prefix openssl)/lib" export CPPFLAGS="-I$(brew --prefix openssl)/include" export PKG_CONFIG_PATH="$(brew --prefix openssl)/lib/pkgconfig" export CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" export CFLAGS="-I$(brew --prefix readline)/include $CFLAGS" export LDFLAGS="-L$(brew --prefix readline)/lib $LDFLAGS" export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
I had same issue and fixed.
brew update
brew upgrade
brew install llvm
export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
rbenv install 2.7.1
rbenv rehash
macOS 10.14 is EOL today. Unfortunately, I couldn't investigate and fix it. If you still face this issue with Catalina or Big Sur, Can you file it with new issue? Thanks.
Most helpful comment
I had same issue and fixed.