1

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:

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
tadman
  • 208,517
  • 23
  • 234
  • 262
zli
  • 307
  • 1
  • 12
  • So did you get openssl 1.0 *and* the development headers/libs installed successfully? – D. SM Feb 09 '21 at 21:44
  • These versions may not be supported without additional work. – tadman Feb 09 '21 at 22:52
  • 1
    This isn't really an answer but there are alternatives like [asdf](https://asdf-vm.com/) that work pretty well – t56k Feb 09 '21 at 22:59
  • @D.SM i instailled rbenv/tap/openssl@1.0 successfully, not sure what you mean by the development headers/libs though – zli Feb 10 '21 at 23:33

0 Answers0