2无法加载此类文件

2无法加载此类文件

本文介绍了安装了rbenv的ruby 2.1.2无法加载此类文件-MAC OSX 10.9.2上的zlib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过rbenv安装ruby 2.1.2,并且rbenv由homebrew在我的MAC OSX 10.9.2上安装,ruby global成功设置为2.1.2,但是当我尝试运行gem install时,出现一些错误在下面.

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?

推荐答案

您需要安装zlib开发标头.

You need to install the zlib development headers.

xcode-select --install

现在在OS X 10.9中,按需安装了命令行开发工具.因此,运行此命令后,zlib和zlib-devel也应该可用.

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.

这篇关于安装了rbenv的ruby 2.1.2无法加载此类文件-MAC OSX 10.9.2上的zlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 20:18