无法在Mojave上安装jazzy

时间:2018-08-21 10:19:25

标签: swift xcode beta macos-mojave jazzy

我试图在Mojave Beta上安装jazzy,但由于出现此错误而未能安装

MacBook-Pro-Damian:~ damiandudycz$ sudo gem install jazzy
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing jazzy:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0/ext/redcarpet
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180821-24471-1py1trb.rb extconf.rb
creating Makefile

current directory: /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0/ext/redcarpet
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0/ext/redcarpet
make "DESTDIR="
make: *** No rule to make target `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18/ruby/config.h', needed by `autolink.o'.  Stop.

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/redcarpet-3.4.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/redcarpet-3.4.0/gem_make.out

有人可以帮我解决这个问题吗?或者,也许还有其他方法可以在没有gem的情况下安装jazzy

或者您可能知道swift项目的其他好的文档生成器?

3 个答案:

答案 0 :(得分:1)

xcode-select --install为我做了这件事。
之后,我可以通过[sudo] gem install jazzy

安装jazzy

答案 1 :(得分:1)

这对我有用,但不知道为什么。我认为它是从.pkg

手动安装了命令行工具
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

答案 2 :(得分:1)

尝试这个

sudo gem install -n /usr/local/bin jazzy