今天安装jazzy的时候碰到一点问题,记录下来,希望对大家能够有点帮助
本人的操作系统是OS X EI Capitan,os 10.11.6
按照jazzy的开发指南,在终端输入:
sudo gem install jazzy
结果产生如下的错误
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.0.0/gems/redcarpet-3.4.0/ext/redcarpet
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20170704-430-1vx4mno.rb extconf.rb
creating Makefile
current directory: /Library/Ruby/Gems/2.0.0/gems/redcarpet-3.4.0/ext/redcarpet
make "DESTDIR=" clean
current directory: /Library/Ruby/Gems/2.0.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.12.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin15/ruby/config.h', needed by `autolink.o'. Stop.
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/redcarpet-3.4.0 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-15/2.0.0/redcarpet-3.4.0/gem_make.out
按照错误的提示,应该是我的ruby管理包版本比较旧,那么就开始升级吧
要升级ruby,需要安装rvm
showxjndeMacBook-Air:Applications showxjn$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
showxjndeMacBook-Air:Applications showxjn$ rvm -v
-bash: rvm: command not found
showxjndeMacBook-Air:Applications showxjn$ curl -L get.rvm.io | bash -s stable
上述命令依次是查询ruby版本,查询rvm版本,安装rvm
安装好了之后
showxjndeMacBook-Air:Applications showxjn$ source ~/.bashrc
showxjndeMacBook-Air:Applications showxjn$ source ~/.bash_profile
showxjndeMacBook-Air:Applications showxjn$ rvm -v
rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]
更改下路径,rvm安装成功了,接下来,更新ruby
showxjndeMacBook-Air:Applications showxjn$ rvm list known
# MRI Rubies[ruby-]1.8.6[-p420][ruby-]1.8.7[-head] # security released on head[ruby-]1.9.1[-p431][ruby-]1.9.2[-p330][ruby-]1.9.3[-p551][ruby-]2.0.0[-p648][ruby-]2.1[.10][ruby-]2.2[.6][ruby-]2.3[.3][ruby-]2.4[.0]ruby-head# for forks use: rvm install ruby-head---url https://github.com/github/ruby.git --branch 2.2
# JRuby
jruby-1.6[.8]
jruby-1.7[.26]
jruby[-9.1.7.0]
jruby-head
# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx[-3.71]
rbx-head
# Opal
opal
# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1[.2.0]
mruby[-head]
# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]
# Topaz
topaz
# MagLev
maglev[-head]
maglev-1.0.0
# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head
# IronRuby
ironruby[-1.1.3]
ironruby-head
列出可用的安装包和版本
showxjndeMacBook-Air:Applications showxjn$ xcode-select --install
xcode-select: note: install requested for command line developer tools
showxjndeMacBook-Air:Applications showxjn$ rvm install 2.4
ruby-2.4.0 - #removing src/ruby-2.4.0..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.11/x86_64/ruby-2.4.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl@1.1/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/showxjn/.rvm/rubies/ruby-2.4.0, this may take a while depending on your cpu(s)...
ruby-2.4.0 - #downloading ruby-2.4.0, this may take a while depending on your connection...
ruby-2.4.0 - #extracting ruby-2.4.0 to /Users/showxjn/.rvm/src/ruby-2.4.0....
ruby-2.4.0 - #configuring...................................................................
ruby-2.4.0 - #post-configuration.
ruby-2.4.0 - #compiling.............................................................
ruby-2.4.0 - #installing.......
ruby-2.4.0 - #making binaries executable..
ruby-2.4.0 - #downloading rubygems-2.6.12
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 749k 100 749k 0 0 35211 0 0:00:21 0:00:21 --:--:-- 40146
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.4.0 - #extracting rubygems-2.6.12....
ruby-2.4.0 - #removing old rubygems.........
ruby-2.4.0 - #installing rubygems-2.6.12.........................
ruby-2.4.0 - #gemset created /Users/showxjn/.rvm/gems/ruby-2.4.0@global
ruby-2.4.0 - #importing gemset /Users/showxjn/.rvm/gemsets/global.gems..............................................|
ruby-2.4.0 - #generating global wrappers........
ruby-2.4.0 - #gemset created /Users/showxjn/.rvm/gems/ruby-2.4.0
ruby-2.4.0 - #importing gemsetfile /Users/showxjn/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.4.0 - #generating default wrappers........
ruby-2.4.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.4.0 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
接下来就是更新ruby,更新成功后就可以安装jazzy
showxjndeMacBook-Air:Applications showxjn$ sudo gem install jazzy
Password:
Fetching: liferaft-0.0.6.gem (100%)
Successfully installed liferaft-0.0.6
Fetching: xcinvoke-0.3.0.gem (100%)
Successfully installed xcinvoke-0.3.0
Fetching: sqlite3-1.3.13.gem (100%)
Building native extensions. This could take a while...
Successfully installed sqlite3-1.3.13
Fetching: sass-3.4.24.gem (100%)
Successfully installed sass-3.4.24
Fetching: rouge-1.11.1.gem (100%)
Successfully installed rouge-1.11.1
Fetching: redcarpet-3.4.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed redcarpet-3.4.0
Fetching: open4-1.3.4.gem (100%)
Successfully installed open4-1.3.4
Fetching: mustache-0.99.8.gem (100%)
Successfully installed mustache-0.99.8
Fetching: nanaimo-0.2.3.gem (100%)
Successfully installed nanaimo-0.2.3
Fetching: colored2-3.1.2.gem (100%)
Successfully installed colored2-3.1.2
Fetching: claide-1.0.2.gem (100%)
Successfully installed claide-1.0.2
Fetching: CFPropertyList-2.3.5.gem (100%)
Successfully installed CFPropertyList-2.3.5
Fetching: xcodeproj-1.5.0.gem (100%)
Successfully installed xcodeproj-1.5.0
Fetching: ruby-macho-1.1.0.gem (100%)
Successfully installed ruby-macho-1.1.0
Fetching: nap-1.1.0.gem (100%)
Successfully installed nap-1.1.0
Fetching: molinillo-0.5.7.gem (100%)
Successfully installed molinillo-0.5.7
Fetching: gh_inspector-1.0.3.gem (100%)
Successfully installed gh_inspector-1.0.3
Fetching: fourflusher-2.0.1.gem (100%)
Successfully installed fourflusher-2.0.1
Fetching: escape-0.0.4.gem (100%)
Successfully installed escape-0.0.4
Fetching: cocoapods-try-1.1.0.gem (100%)
Successfully installed cocoapods-try-1.1.0
Fetching: netrc-0.7.8.gem (100%)
Successfully installed netrc-0.7.8
Fetching: cocoapods-trunk-1.2.0.gem (100%)
Successfully installed cocoapods-trunk-1.2.0
Fetching: cocoapods-stats-1.0.0.gem (100%)
Successfully installed cocoapods-stats-1.0.0
Fetching: cocoapods-search-1.0.0.gem (100%)
Successfully installed cocoapods-search-1.0.0
Fetching: cocoapods-plugins-1.0.0.gem (100%)
Successfully installed cocoapods-plugins-1.0.0
Fetching: cocoapods-downloader-1.1.3.gem (100%)
Successfully installed cocoapods-downloader-1.1.3
Fetching: cocoapods-deintegrate-1.0.1.gem (100%)
Successfully installed cocoapods-deintegrate-1.0.1
Fetching: fuzzy_match-2.0.4.gem (100%)
Successfully installed fuzzy_match-2.0.4
Fetching: thread_safe-0.3.6.gem (100%)
Successfully installed thread_safe-0.3.6
Fetching: tzinfo-1.2.3.gem (100%)
Successfully installed tzinfo-1.2.3
Fetching: i18n-0.8.4.gem (100%)
Successfully installed i18n-0.8.4
Fetching: activesupport-4.2.9.gem (100%)
Successfully installed activesupport-4.2.9
Fetching: cocoapods-core-1.2.1.gem (100%)
Successfully installed cocoapods-core-1.2.1
Fetching: cocoapods-1.2.1.gem (100%)
Successfully installed cocoapods-1.2.1
Fetching: jazzy-0.8.2.gem (100%)
Successfully installed jazzy-0.8.2
Parsing documentation for liferaft-0.0.6
Installing ri documentation for liferaft-0.0.6
Parsing documentation for xcinvoke-0.3.0
Installing ri documentation for xcinvoke-0.3.0
Parsing documentation for sqlite3-1.3.13
Installing ri documentation for sqlite3-1.3.13
Parsing documentation for sass-3.4.24
Installing ri documentation for sass-3.4.24
Parsing documentation for rouge-1.11.1
Installing ri documentation for rouge-1.11.1
Parsing documentation for redcarpet-3.4.0
Installing ri documentation for redcarpet-3.4.0
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for mustache-0.99.8
Installing ri documentation for mustache-0.99.8
Parsing documentation for nanaimo-0.2.3
Installing ri documentation for nanaimo-0.2.3
Parsing documentation for colored2-3.1.2
Installing ri documentation for colored2-3.1.2
Parsing documentation for claide-1.0.2
Installing ri documentation for claide-1.0.2
Parsing documentation for CFPropertyList-2.3.5
Installing ri documentation for CFPropertyList-2.3.5
Parsing documentation for xcodeproj-1.5.0
Installing ri documentation for xcodeproj-1.5.0
Parsing documentation for ruby-macho-1.1.0
Installing ri documentation for ruby-macho-1.1.0
Parsing documentation for nap-1.1.0
Installing ri documentation for nap-1.1.0
Parsing documentation for molinillo-0.5.7
Installing ri documentation for molinillo-0.5.7
Parsing documentation for gh_inspector-1.0.3
Installing ri documentation for gh_inspector-1.0.3
Parsing documentation for fourflusher-2.0.1
Installing ri documentation for fourflusher-2.0.1
Parsing documentation for escape-0.0.4
Installing ri documentation for escape-0.0.4
Parsing documentation for cocoapods-try-1.1.0
Installing ri documentation for cocoapods-try-1.1.0
Parsing documentation for netrc-0.7.8
Installing ri documentation for netrc-0.7.8
Parsing documentation for cocoapods-trunk-1.2.0
Installing ri documentation for cocoapods-trunk-1.2.0
Parsing documentation for cocoapods-stats-1.0.0
Installing ri documentation for cocoapods-stats-1.0.0
Parsing documentation for cocoapods-search-1.0.0
Installing ri documentation for cocoapods-search-1.0.0
Parsing documentation for cocoapods-plugins-1.0.0
Installing ri documentation for cocoapods-plugins-1.0.0
Parsing documentation for cocoapods-downloader-1.1.3
Installing ri documentation for cocoapods-downloader-1.1.3
Parsing documentation for cocoapods-deintegrate-1.0.1
Installing ri documentation for cocoapods-deintegrate-1.0.1
Parsing documentation for fuzzy_match-2.0.4
Installing ri documentation for fuzzy_match-2.0.4
Parsing documentation for thread_safe-0.3.6
Installing ri documentation for thread_safe-0.3.6
Parsing documentation for tzinfo-1.2.3
Installing ri documentation for tzinfo-1.2.3
Parsing documentation for i18n-0.8.4
Installing ri documentation for i18n-0.8.4
Parsing documentation for activesupport-4.2.9
Installing ri documentation for activesupport-4.2.9
Parsing documentation for cocoapods-core-1.2.1
Installing ri documentation for cocoapods-core-1.2.1
Parsing documentation for cocoapods-1.2.1
Installing ri documentation for cocoapods-1.2.1
Parsing documentation for jazzy-0.8.2
Installing ri documentation for jazzy-0.8.2
Done installing documentation for liferaft, xcinvoke, sqlite3, sass, rouge, redcarpet, open4, mustache, nanaimo, colored2, claide, CFPropertyList, xcodeproj, ruby-macho, nap, molinillo, gh_inspector, fourflusher, escape, cocoapods-try, netrc, cocoapods-trunk, cocoapods-stats, cocoapods-search, cocoapods-plugins, cocoapods-downloader, cocoapods-deintegrate, fuzzy_match, thread_safe, tzinfo, i18n, activesupport, cocoapods-core, cocoapods, jazzy after 30 seconds
35 gems installed
好了,安装成功了