rbenv installed ruby 2.1.2 cannot load such file — zlib on MAC OSX 10.9.2

此生再无相见时 提交于 2019-12-18 17:57:11

问题


I'm install ruby 2.1.2 via rbenv, and rbenv is installed by homebrew on my MAC OSX 10.9.2, ruby global is successful set to 2.1.2, but when i try to run gem install, get some errors below.

MacBook-Pro:~ user1$ gem install bundler
ERROR:  Loading command: install (LoadError)
    cannot load such file -- zlib
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

How to solve it, does anyone faced same problems before?


回答1:


You need to install the zlib development headers.

xcode-select --install

In OS X 10.9, the command line developer tools are now installed on demand. So after running this also zlib and zlib-devel should be available.



来源:https://stackoverflow.com/questions/23781657/rbenv-installed-ruby-2-1-2-cannot-load-such-file-zlib-on-mac-osx-10-9-2

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