12

After upgrading MacOS to 10.14.2 Mojave, I'm not able to install any Ruby Version with RVM anymore. It always gives an error like this:

$rvm install 2.5.3
ruby-2.5.3 - #removing src/ruby-2.5.3..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.5.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/jdinse/.rvm/rubies/ruby-2.5.3, this may take a while depending on your cpu(s)...
ruby-2.5.3 - #downloading ruby-2.5.3, this may take a while depending on your connection...
ruby-2.5.3 - #extracting ruby-2.5.3 to /Users/jdinse/.rvm/src/ruby-2.5.3.....
ruby-2.5.3 - #configuring....................................................................
ruby-2.5.3 - #post-configuration.
ruby-2.5.3 - #compiling....................
Error running '__rvm_make -j4',
please read /Users/jdinse/.rvm/log/1547136259_ruby-2.5.3/make.log

There has been an error while running make. Halting the installation.

Looking into make.log, the only errors are like this:

making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
linking static-library libruby.2.5.3-static.a
libtool: object: dln.o malformed object (unknown load command 1)
libtool: object: localeinit.o malformed object (unknown load command 1)
libtool: object: loadpath.o malformed object (unknown load command 1)
libtool: object: array.o malformed object (unknown load command 1)
libtool: object: bignum.o malformed object (unknown load command 1)
libtool: object: class.o malformed object (unknown load command 1)
...

What I've tried so far:

  • reinstalled RVM
  • trying previous RVM 1.29.6 or master branch
  • reinstalled Homebrew
  • reinstalled XCode
  • reinstalled Command Line Tools
  • installed gcc, gcc@7 or gcc@8 with homebrew, or uninstalled all of them
  • installed openssl or openssl@1.1, or uninstalled all of them

Nothing of this nor any other tips of similar questions helped.

Any ideas? Or any idea what caused the error libtool: object: dln.o malformed object (unknown load command 1) and how to fix it?

Jay Dinse
  • 504
  • 4
  • 19

3 Answers3

7

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!

Ryan Crews
  • 3,015
  • 1
  • 32
  • 28
  • Bingo!!! After the step of unistalling MacPorts I tried to install Ruby via RVM again and it worked. BTW, while unstalling all old Macports packages, I have noticed that `boost` were uninstalled as well. – Jay Dinse Apr 23 '19 at 15:47
2

Do you have multiple versions of boost installed? I took the following steps to fix this (although I was using rbenv).

First I removed my xcode lib: rm -rf /Library/Developer/CommandLineTools

Then I reinstalled it: xcode-select --install

Then I ran brew ls and noticed I had two versions of boost. boost and boost@1.6.0. I removed boost@1.6.0 and boost and reinstalled boost and made sure it was linked via brew link boost.

Seemed to work after that.

eddiewang
  • 415
  • 5
  • 21
  • I did that and removed my brew installation. Reinstalled brew BUT didn't install anything. Did `rvm install ruby-2.6.0` then let rvm install the dependencies `Installing required packages: autoconf, automake, libtool, pkg-config, coreutils, libyaml, readline, libksba, openssl@1.1`... – bxiong Jan 20 '19 at 00:41
  • I have the same problem as Jay Dinse. I did not have boost installed but still I have this issue. – Smek Mar 03 '19 at 08:23
1

I was finally able to fix it by completely removing (a very old version of) MacPorts. Everything else kept giving me the same issues.

Hope this works for you as well. It took me more than a day to find a hint that lead me to this point.