简体   繁体   中英

Gem fails to build native extensions while installing jekyll

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

尝试使用RVM重新安装ruby

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM