尝试安装jekyll时出现错误

时间:2017-10-18 16:03:46

标签: ruby apache rubygems jekyll

我在安装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

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

其他非常感谢提前

罗宾

2 个答案:

答案 0 :(得分:0)

此类错误通常意味着您没有安装构建工具。 据我所知,你使用的是linux,所以你可以运行像

这样的东西
apt-get install build-essential

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

答案 1 :(得分:0)

我在安装时遇到了同样的错误。你将不得不安装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。