我正在尝试在我的Mac上安装Jekyll
。我的mac版本为10.9
,ruby版本为2.0.0
。但是当我在终端中使用sudo gem install jekyll
时,就会出现这样的错误:
➜ ~ 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
我在这里看了一下,尝试了很多方法,但没有一种方法可行。我该如何解决这个问题?
答案 0 :(得分:11)
看起来你没有通过rvm安装/管理ruby。我肯定会在os x上推荐rvm和homebrew。他们会为你节省很多头痛。
以下是关于如何进行设置的良好链接:
<击> http://dean.io/setting-up-a-ruby-on-rails-development-environment-on-mavericks/ 击> https://deanpcmad.com/blog/setting-up-a-ruby-on-rails-development-environment-on-mavericks
答案 1 :(得分:6)
它适用于ruby-2.1.1 所以你必须
rvm use ruby-2.1.1
和
sudo gem install jekyll
P.S。如果你没有rvm - 在之前安装它:)
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
\curl -sSL https://get.rvm.io | bash -s stable
答案 2 :(得分:2)