问题
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