2017-10-18 205 views
0

我在安装jekyll时遇到了一些麻烦。无法完全弄清楚如何修补缺失的链接。试图安装jekyll时出现错误

继承人完整的信息:

[email protected]:~# 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 强大的文本安装

红宝石:

[email protected]:~# ruby -v 
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] 

的Debain 8安装

- 

Apache2的安装:

[email protected]:~# apache2 -v 
Server version: Apache/2.4.10 (Debian) 
Server built: Sep 20 2017 04:37:43 

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

其他感谢已经时间提前

罗宾

回答

0

这种错误通常意味着你没有安装编译工具做。 据我了解你使用Linux,这样你就可以运行类似

apt-get install build-essential 

这个命令是为了DEB-基地发行版。所以如果你使用不同的发行版,你可以使用类似的东西。

0

安装时出现同样的错误。您需要安装des dev 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版也可以在这个仓库。

+0

apt-add-repository不是可用命令 –