Ruby 没怎么用过,语法都不太懂,能 Google 也 Google 了,能想到的都尝试了,折腾很久无果。
apt-get -yqq install ruby2.0 ruby2.0-dev make nodejs
这是 1.x 版本
root@7e86a6002ca5:/# gem install --no-rdoc --no-ri jekyll
Fetching: liquid-3.0.6.gem (100%)
Fetching: kramdown-1.9.0.gem (100%)
Fetching: mercenary-0.3.5.gem (100%)
Fetching: safe_yaml-1.0.4.gem (100%)
Fetching: colorator-0.1.gem (100%)
Fetching: rouge-1.10.1.gem (100%)
Fetching: sass-3.4.21.gem (100%)
Fetching: jekyll-sass-converter-1.4.0.gem (100%)
Fetching: rb-fsevent-0.9.7.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.10/ext/ffi_c/gem_make.out
这是 2.0 版本
root@7e86a6002ca5:/# gem2.0 install --no-rdoc --no-ri jekyll
......
Fetching: ffi-1.9.10.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby2.0
--with-ffi_c-dir
--without-ffi_c-dir
--with-ffi_c-include
--without-ffi_c-include=${ffi_c-dir}/include
--with-ffi_c-lib
--without-ffi_c-lib=${ffi_c-dir}/
--with-libffi-config
--without-libffi-config
--with-pkg-config
--without-pkg-config
/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
from /usr/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
from /usr/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
from /usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /usr/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
from /usr/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
from extconf.rb:16:in `<main>'
Gem files will remain installed in /var/lib/gems/2.0.0/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/2.0.0/gems/ffi-1.9.10/ext/ffi_c/gem_make.out