升级到 Xcode 4.1 后无法安装 Jekyll gem
我之前已经使用 Xcode 3 附带的 gcc 编译器在 Mac 上成功安装了 Jekyll gem。不幸的是,我无法将其安装在现在具有 Xcode 4.1 的其他 Mac 上。这台 Mac 曾经装有 Xcode 3,但我使用命令 sudo /Developer-3.2.5/Library/uninstall-devtools --mode=all
卸载了它。
当尝试 sudo gem install jekyll 时,我收到如下所示的编译错误:
Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb creating Makefile make gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c porter.c porter.c:31:44: error: stdlib.h: No such file or directory porter.c:32:47: error: string.h: No such file or directory porter.c: In function ‘create_stemmer’: porter.c:85: warning: incompatible implicit declaration of built-in function ‘malloc’ porter.c: In function ‘setto’: porter.c:199: warning: incompatible implicit declaration of built-in function ‘memmove’ make: *** [porter.o] Error 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0/ext/gem_make.out
这里似乎存在一个相当基本的问题!我该如何解决这个问题?我正在使用 Ruby 1.8.7 和 RubyGems 1.3.7 1.8.10。
提前致谢。
I have previously successfully installed the Jekyll gem on a Mac with the gcc compiler that shipped with Xcode 3. Unfortunately I can't install it on a different Mac that now has Xcode 4.1. This Mac used to have Xcode 3, but I uninstalled it using the command sudo /Developer-3.2.5/Library/uninstall-devtools --mode=all
.
When trying to sudo gem install jekyll
I get the compilation error shown below:
Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/local/bin/ruby extconf.rb creating Makefile make gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I/usr/local/lib/ruby/1.8/i686-darwin10.3.2 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -c porter.c porter.c:31:44: error: stdlib.h: No such file or directory porter.c:32:47: error: string.h: No such file or directory porter.c: In function ‘create_stemmer’: porter.c:85: warning: incompatible implicit declaration of built-in function ‘malloc’ porter.c: In function ‘setto’: porter.c:199: warning: incompatible implicit declaration of built-in function ‘memmove’ make: *** [porter.o] Error 1 Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0/ext/gem_make.out
There seems to be a fairly fundamental problem here! How can I fix this? I'm using Ruby 1.8.7 and RubyGems 1.3.7 1.8.10.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在运行
gem install jekyll
之前,尝试输入export CC=gcc-4.2
,如下所示:RVM with Lion 如果这解决了您的问题,这是因为 gems 依赖于 GCC 而不是 LLVM,后者现在是 4.1 中的默认值。将export CC=gcc-4.2
添加到 ~/.bashrc 文件中,这样就不必每次需要编译 gem 时都输入它。Before running
gem install jekyll
try enteringexport CC=gcc-4.2
as per: RVM with Lion If this fixes your issue, it's because gems is depending on GCC instead of LLVM, which is now default in 4.1. Add theexport CC=gcc-4.2
to your ~/.bashrc file to not have to enter it every time you need to compile gem.RubyGems 1.3.7 已经过时了。我们正在谈论1.8.9...我建议您升级它。
我使用 Lion 没有任何问题,但我必须承认我没有使用系统 Ruby。我使用 RVM 安装了不同的 1.8.7(和 1.9.2)版本。
RubyGems 1.3.7 is quite out of date. We're talking about 1.8.9... I suggest you to upgrade it.
I'm using Lion without any issue, but I have to admit I'm not using system Ruby. I installed a different 1.8.7 (and 1.9.2) version using RVM.
现在这很奇怪。我昨晚重新安装了 Xcode 4.1,它解决了问题:我可以编译本机扩展并安装 Jekyll gem。
我能够重新安装 Xcode,因为根据 Mac App Store,它根本没有安装,尽管我一直很高兴地使用它!我认为商店必须在
/Applications
文件夹中查找是否存在 Install XCode 应用程序,我已将其删除,因为它只是一个安装程序,占用了超过 3GB 的空间。Now this is weird. I reinstalled Xcode 4.1 last night and it's fixed the problem: I can compile the native extensions and install the Jekyll gem.
I was able to reinstall Xcode because according to the Mac App Store it wasn't installed at all, even though I've been happily using it! I think the store must look for the existence of the Install XCode application in the
/Applications
folder, which I'd deleted because it's just an installer and takes up over 3GB.