本文介绍了Rubygems 无法安装在 OS X Lion 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以前对红宝石、宝石和所有相关的东西都没有任何问题.但是在安装 X Code Developer Tools 并升级到 Lion 之后,gem 并没有安装.

I used to have no problems at all with ruby, gems and all related stuff. But after installing X Code Developer Tools and upgrading to Lion the gems do not install.

我收到每个宝石的以下错误.这是以 sqlite 为例的消息:

I get the following error for every gem. This is the message for sqlite as an example:

Building native extensions.  This could take a while...
ERROR:  Error installing sqlite3:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.4 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out

出了什么问题?如何解决?

What went wrong? How to fix it?

推荐答案

我必须在最新的 Xcode-Version (4.3.1) 中安装命令行工具,并且

I had to install the Command Line Tools in the latest Xcode-Version (4.3.1) and

sudo gem install rails

工作就像一个魅力.

要安装命令行工具,请转到 Xcode Preferences > Downloads 或在终端中使用以下命令 (thx @Purell):

To install Command Line Tools, go to Xcode Preferences > Downloads or use the following command in terminal (thx @Purell):

xcode-select --install

这篇关于Rubygems 无法安装在 OS X Lion 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 06:37