4

I have these to ansible tasks for installing jekyll on a ubuntu 14.04 VM :

  - name: install ruby
    apt: pkg=ruby state=latest
    sudo: yes

  - name: install jekyll
    gem: name=jekyll version=2.5.3
    sudo: yes

The jekyll install is failing with this message :

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
Matt V.
  • 9,703
  • 10
  • 35
  • 56
Max L.
  • 9,774
  • 15
  • 56
  • 86
  • To install jekyll on Ubuntu, don't you need to install ruby-dev as well before? Like mentionned here: https://stackoverflow.com/questions/10725767/error-installing-jekyll-native-extension-build – Sylhare Oct 03 '17 at 01:57

1 Answers1

0

Try to reinstall ruby with RVM

Quanlong
  • 24,028
  • 16
  • 69
  • 79