I'm trying to install a few ruby versions < 2.4.0 to build a local app:
brew update
brew install watchman rbenv ruby-build
rbenv install 2.3.6
rbenv install 2.1.10
rbenv install 1.9.3-p551
Unfortunately it fails with:
BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20210119)
Last 10 log lines:
_cca_rsa_sign in e_4758cca.o
_cca_rsa_verify in e_4758cca.o
"_i2d_X509_SIG", referenced from:
_cca_rsa_sign in e_4758cca.o
_cca_rsa_verify in e_4758cca.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[2]: *** [link_o.darwin] Error 1
make[1]: *** [lib] Error 2
make: *** [build_engines] Error 1
This led me to try things suggested by: https://github.com/rbenv/ruby-build/issues/1353
brew install rbenv/tap/openssl@1.0
brew --prefix openssl@1.0
export LDFLAGS="-L/usr/local/opt/openssl@1.0/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.0/include"
CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" rbenv install 2.3.6
But this also fails with:
...
verifying static-library libruby-static.a
ld: warning: ignoring file libruby-static.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture x86_64:
"_ruby_init", referenced from:
_main in main.o
"_ruby_init_stack", referenced from:
_main in main.o
"_ruby_options", referenced from:
_main in main.o
"_ruby_run_node", referenced from:
_main in main.o
"_ruby_sysinit", referenced from:
_main in main.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: *** [libruby-static.a] Error 1
BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20210119)
I tried a whole host of other solutions from what others suggested online with similar issues:
- Ruby install aborted due to missing extensions: openssl, readline, zlib compilation error
fails with the the
libruby-static.a
linking failure above - https://github.com/rvm/rvm/issues/3247
brew remove --force $(brew list)
fails withlibruby-static.a
linking failure above - https://github.com/rbenv/ruby-build/issues/1327
Again fails withbrew uninstall rbenv ruby-build rm -rf /usr/local/bin/{rdoc,ri,ruby} rm -rf /usr/local/lib/ruby rm -rf ~/.local/share/{gem,rbenv} brew install rbenv eval "$(rbenv init -)"
libruby-static.a
linking failure above - https://github.com/rbenv/rbenv/issues/1059
Still fails with$ brew uninstall openssl $ brew --prefix openssl $ sudo mv /usr/local/include /usr/local/include_old $ rm ~/.rbenv Add path found with brew --prefix openssl to .zshrc export PATH="/usr/local/opt/openssl@1.1/bin:$PATH" export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
libruby-static.a
linking failure above
Finally I even did a fresh install of Mac OS 10.15.7 and installed Command_Line_Tools_for_Xcode_11.5.dmg from https://developer.apple.com/download/more/?=xcode, but I'm still getting that libruby-static.a
linking failure.
Obviously I'm pretty lost... any help or pointers are appreciated!
Versions: Mac OS 10.15.7
$ clang -v
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin