尝试在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
答案 0 :(得分:2)
您的问题出现在Xcode 5.1中。为了避免与MacOS的ruby版本(这一个和许多其他版本)相关的许多问题,真的应该使用RVM。
如果您还没有它,请首先安装Homebrew :(这不是绝对必要的,但允许我们安装ruby及其依赖项而无需编译)
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
但我打赌会有更多问题出现。
答案 1 :(得分:1)
你绝对应该使用RVM。以下是步骤:
安装Homebrew。
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
按照Homebrew install中列出的其他说明进行操作。
brew doctor
安装RVM。
\curl -L https://get.rvm.io | bash -s stable --ruby
在安装RVM时遵循其他说明。
source ~/.rvm/scripts/rvm
安装jekyll。
gem install jekyll
测试jekyll。
$ jekyll serve
Configuration file: none
Source: /private/var/log
Destination: /private/var/log/_site
Generating... done.
Server address: ...
Server running... press ctrl-c to stop.
答案 2 :(得分:0)
1)xcode-select --install
2)brew install ruby
3)sudo gem install jekyll
4)sudo gem install jekyll-import