尝试在 OSX Mavericks 上安装稳定版的 Jekyll。我安装了 Xcode 和命令行工具,但出现此错误:
sudo gem install jekyll
Password:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling porter.c
porter.c:359:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~
porter.c:359:27: note: place parentheses around the '&&' expression to silence this warning
if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
^
( )
1 warning generated.
compiling porter_wrap.c
linking shared-object stemmer.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [stemmer.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/fast-stemmer-1.0.2/gem_make.out
最佳答案
您的问题出现在 Xcode 5.1 中。为了避免与 MacOS 的 ruby 版本(这个和许多其他版本)相关的许多问题,您真的应该使用 RVM .
如果您还没有,请先安装 Homebrew:(这不是绝对必要的,但允许我们安装 ruby 及其依赖项而无需 looong 编译)
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
然后,以下命令将安装 RVM 和最新版本的 Ruby:
\curl -L https://get.rvm.io | bash -s stable --ruby
检查一切是否正常:
ruby --version
您现在可以安装 Jekyll:
gem install jekyll
现在,如果您真的不想使用 RVM,您可以执行:
sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll
但我敢打赌还会有更多的问题。
关于ruby - 在 Mac OS Mavericks (10.9.2) 上安装 Jekyll 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23033383/