Cannot install any version of ruby on Mojave - internal ranlib command failed

社会主义新天地 提交于 2019-12-03 13:40:16

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!

So, I think the fix to this was running:

$ sudo xcodebuild -runFirstLaunch

Why? I'm not sure. My suspicion is I tried to build ruby before updating XCode. But once I had updated XCode I suspect the wrong/older command line tool was still being referenced somehow.

I don't know exactly what fixed this but I completely deleted XCode and ruby still didn't install.

Then I completely deleted command line tools and ruby still didn't install.

Then I reinstalled just the command line tools without XCode and ruby still didn't install.

Then I ran this runFirstLaunch command and ruby installed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!