I know there are a few silimar issues to this one, but I cannot find one that matches my issue.
I cannot install any version of ruby with either rvm nor rbenv. Both result in the same error. For example, here's an extract for the logs when installing ruby 2.5.3:
compiling loadpath.c
making srcs under enc
linking static-library libruby.2.5.3-static.a
make[1]: Nothing to be done for `srcs'.
generating transdb.h
/opt/local/bin/ranlib: object: libruby.2.5.3-static.a(dln.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make: *** [libruby.2.5.3-static.a] Error 1
make: *** Waiting for unfinished jobs....
transdb.h updated
The issue seems to be here:
/opt/local/bin/ranlib: object: libruby.2.5.3-static.a(dln.o) malformed object (unknown load command 1)
ar: internal ranlib command failed
make: *** [libruby.2.5.3-static.a] Error 1
What is causing this?
gcc --version
returns:
gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.0 (clang-1000.10.44.4)
Target: x86_64-apple-darwin18.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
For anyone else who steps on the same landmine, for me it was that there was an incompatible copy of ranlib
from homebrew
via the cctools
package. To fix it, I just uninstalled it:
brew uninstall cctools
For those who find this and aren't helped by the above solution...
I ran into this issue as well. In my case it was due to MacPorts being outdated after I upgraded to (MacOS) Mojave.
I followed the steps listed on MacPorts' migration guide here: https://trac.macports.org/wiki/Migration
Closed and reopened Terminal (just b/c)
ran rvm install ruby
and got Install of ruby-2.6.0 - #complete
, hooray!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With