sudo gem install jekyll - 失败 - clang错误未知参数

时间:2014-04-01 04:45:48

标签: ruby gem clang

Jekyll未能通过以下gem install安装,这是错误。下面还有一些版本的东西和位置。

sudo gem install jekyll                                                                                                                                    
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

来自命令终端的直接输出:

[~]$ which ruby
/usr/bin/ruby

[~]$ ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

[~]$ which gem 
/usr/bin/gem
[~]$ gem --version
2.2.2

[~]$ which clang
/usr/bin/clang

[~]$ clang --version
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

OSX 10.9.2,Xcode版本5.1

1 个答案:

答案 0 :(得分:6)

Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply_definedsuppress'

中遇到同样的问题

我发现此问题中有关jekyll repo的评论有用: https://github.com/jekyll/jekyll/issues/2125

如果您正在使用rvm或rbenv,则可以检查Ruby 2.1.1,它应该可以顺利安装。

否则你可以安装 ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll

希望这有帮助!