我有这些用于在ubuntu 14.04 VM上安装jekyll的安装任务:
- name: install ruby
apt: pkg=ruby state=latest
sudo: yes
- name: install jekyll
gem: name=jekyll version=2.5.3
sudo: yes
jekyll安装失败并显示以下消息:
failed: [192.168.78.29] => {"cmd": "/usr/bin/gem install --version 2.5.3 --include-dependencies --user-install --no-rdoc --no-ri jekyll", "failed": true, "rc": 1}
stderr: WARNING: You don't have /root/.gem/ruby/1.9.1/bin in your PATH,
gem executables will not run.
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:1:in `<main>'
Gem files will remain installed in /root/.gem/ruby/1.9.1/gems/yajl-ruby-1.2.1 for inspection.
Results logged to /root/.gem/ruby/1.9.1/gems/yajl-ruby-1.2.1/ext/yajl/gem_make.out
stdout: INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Building native extensions. This could take a while...
msg: WARNING: You don't have /root/.gem/ruby/1.9.1/bin in your PATH,
gem executables will not run.
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:1:in `<main>'
Gem files will remain installed in /root/.gem/ruby/1.9.1/gems/yajl-ruby-1.2.1 for inspection.
Results logged to /root/.gem/ruby/1.9.1/gems/yajl-ruby-1.2.1/ext/yajl/gem_make.out
FATAL: all hosts have already failed -- aborting