Mac上自带了ruby,版本信息如下:
qiyongdeMacBook-Air:webproxy qiyong$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
$sudo gem update --system
(关于一些更新命令的补充
$ gem install rubygems-update #可能需要管理员权限
$ update_rubygems #这里也一样)
—————Terminal output——————————
Updating rubygems-update
Fetching: rubygems-update-2.5.0.gem (100%)
Successfully installed rubygems-update-2.5.0
Parsing documentation for rubygems-update-2.5.0
Installing ri documentation for rubygems-update-2.5.0
Installing darkfish documentation for rubygems-update-2.5.0
Installing RubyGems 2.5.0
RubyGems 2.5.0 installed
Parsing documentation for rubygems-2.5.0
Installing ri documentation for rubygems-2.5.0
$sudo gem install jekyll
—————Terminal output——————————
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20151129-5728-5lq17h.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
以上命令失败后,执行以下命令,安装Xcode命令行工具,安装成功后,再执行$sudo gem install jekyll
xcode-select --install
————————一些有用的帖子—————————
How to update Ruby to 1.9.x on Mac?
Mac终端安装“Install Command Line Developer Tools”
原文地址:https://www.cnblogs.com/jonky/p/10155266.html