问题描述
我以前没有遇到任何问题,包括红宝石,宝石和所有相关的东西。但是在安装了X代码开发工具并升级到Lion之后,这些宝石就不会安装。
每个宝石都会出现以下错误。这是以sqlite为例的消息:
构建原生扩展。这可能需要一段时间...
错误:安装sqlite3时出错:
错误:无法构建gem本机扩展。
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb无法找到ruby的头文件在/ System / Library / Frameworks / Ruby.framework / Versions / 1.8 / usr / lib / ruby / ruby.h
Gem文件将保留安装在/Library/Ruby/Gems/1.8/gems/sqlite3-1.3中。 4进行检查。
结果记录到/Library/Ruby/Gems/1.8/gems/sqlite3-1.3.4/ext/sqlite3/gem_make.out
出了什么问题?如何解决它?
我必须在最新的Xcode-Version(4.3.1)中安装命令行工具,
sudo gem install rails
$ b
像魅力一样工作。
要安装命令行工具,请转至Xcode首选项>下载,或者在终端中使用以下命令(thx @ Purell ):
xcode-select --install
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.
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?
I had to install the Command Line Tools in the latest Xcode-Version (4.3.1) and
sudo gem install rails
worked like a charm.
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上安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!