安装jazzy
$ sudo gem install jazzy
·····
Parsing documentation for xcinvoke-0.3.0
Installing ri documentation for xcinvoke-0.3.0
Parsing documentation for jazzy-0.10.0
Installing ri documentation for jazzy-0.10.0
Done installing documentation for mustache, open4, redcarpet, rouge, ffi, rb-inotify, rb-fsevent, sass-listen, sass, liferaft, xcinvoke, jazzy after 58 seconds
12 gems installed
这里就说明安装成功
jazzy 操作
使用很简单只需要在项目根目录下执行下命令即可:
$ jazzy --min-acl internal
遇到的问题
1.安装是遇到的问题
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/redcarpet-3.5.0/ext/redcarpet
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20190906-93824-4j4s2f.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/redcarpet-3.5.0 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/redcarpet-3.5.0/gem_make.out
这是由于本地安装的ruby版本低导致的问题,更新ruby版本即可
$ brew upgrade ruby
2.权限问题
$ sudo gem install jazzy
Fetching: mustache-1.1.0.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
执行下命令即可:
$ sudo gem install jazzy -n /usr/local/bin/
3.执行jazzy命令是问题
xcodebuild: error: The directory /Users/liubing/Desktop/iosmodao/iOSmodao does not contain an Xcode project, workspace or package.
...
Please confirm that `xcodebuild` is building a Swift module.
需要将项目编译下即可执行成功
参考:[https://www.jianshu.com/p/3a4f697ac82b](https://www.jianshu.com/p/3a4f697ac82b)
网友评论