升级到 Xcode 4.1 后无法安装 Jekyll gem

发布于 2024-12-02 06:49:36 字数 1365 浏览 4 评论 0原文

我之前已经使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

孤寂小茶 2024-12-09 06:49:37

在运行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 entering export 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 the export CC=gcc-4.2 to your ~/.bashrc file to not have to enter it every time you need to compile gem.

小瓶盖 2024-12-09 06:49:37

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.

梦过后 2024-12-09 06:49:36

现在这很奇怪。我昨晚重新安装了 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文