Library not loaded: /opt/local/lib/libffi.5.dylib but I'm using homebrew

喜你入骨 提交于 2019-12-05 10:33:25

I have ended up in this situation after uninstalling MacPorts (I thought homebrew will be enough, but doesn't seem so). It stopped my cocoapods from updating/installing.

To make it work like a charm, I did:

$ sudo port install libffi

With otool and install_name_tool, you may fix the dependency problem. See Creating working dylibs for detail.

I'm using rvm, and I resolved it by reinstalling the ffi gem

gem uninstall ffi

gem install ffi ##or inside rails project folder run bundle install

I think this is best explained as a compatibility issue between Mac OS X and older versions of the ffi gem. That is why in some cases simply uninstalling and reinstalling the gem can work.

In my case ffi version 1.0.7 was specified in a project's Gemfile. My tests failed with Library not loaded: /opt/local/lib/libffi.5.dylib on that version, but if I tried latest version 1.9.3, it installed and worked without any fuss.

I was lucky and the need for that restriction on the project was placed years ago and no longer appears to be a requirement. So in the end I moved forward with later version of ffi gem.

I suspect there may be a way to get version 1.0.7 happily installed and working on OS X 10.9.2, but I do not know what that might be.

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