【问题标题】:When attempting to install jekyll appears an error尝试安装 jekyll 时出现错误
【发布时间】:2017-10-18 16:03:45
【问题描述】:

我在安装 jekyll 时遇到了一些问题。不太清楚如何修补丢失的链接。

这是完整的帖子:

root@cherob:~# gem install jekyll
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
ERROR: Failed to build gem native extension.

/usr/bin/ruby2.1 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.1
        --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}/lib
        --with-libffi-config
        --without-libffi-config
        --with-pkg-config
        --without-pkg-config
/usr/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
        from /usr/lib/ruby/2.1.0/mkmf.rb:1067:in `block in have_header'
        from /usr/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
        from /usr/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
        from /usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
        from /usr/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
        from /usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
        from /usr/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
        from /usr/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
        from /usr/lib/ruby/2.1.0/mkmf.rb:1066:in `have_header'
        from extconf.rb:16:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/ffi-1.9.18 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0

/ffi-1.9.18/gem_make.out强文本

Ruby 已安装:

root@cherob:~# ruby -v
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]

Debain 8 已安装

-

Apache2 已安装:

root@cherob:~# apache2 -v
Server version: Apache/2.4.10 (Debian)
Server built:   Sep 20 2017 04:37:43

如果你有想法,我会很高兴转发给我。

其他感谢已经提前数次了

罗宾

【问题讨论】:

    标签: ruby apache rubygems jekyll


    【解决方案1】:

    此类错误通常意味着您没有安装构建工具。 据我了解,您使用的是 linux,因此您可以运行类似

    apt-get install build-essential
    

    此命令适用于 deb-bases 发行版。因此,如果您使用不同的发行版,您可以使用类似的东西。

    【讨论】:

      【解决方案2】:

      我在安装时遇到了同样的错误。你必须安装 des Ruby dev packacke:

      sudo apt-get install ruby2.4-dev
      

      这将安装 2.4 的开发包。您应该在使用此版本时安装 2.1。我遇到了问题,在存储库中找不到该包。所以我使用了以下 PPA:

      $ sudo apt-add-repository ppa:brightbox/ruby-ng
      $ sudo apt-get update
      

      https://launchpad.net/~brightbox/+archive/ubuntu/ruby-ng

      此存储库中还提供了 2.1 版。

      【讨论】:

        猜你喜欢
        • 2014-05-15
        • 2018-12-16
        • 1970-01-01
        • 2023-01-03
        • 1970-01-01
        • 2020-12-04
        • 2021-11-18
        • 2014-05-01
        • 2021-05-25
        相关资源
        最近更新 更多