无法在Mint上安装Jekyll

时间:2016-12-10 03:48:16

标签: ruby-on-rails ruby rubygems jekyll

我安装了ruby和ruby gems,更新了它们,尝试使用命令安装jekyll

sudo gem install jekyll bundler

它给了我这个

Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.14/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20161209-4826-wdshax.rb 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/$(RUBY_BASE_NAME)2.3
    --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.3.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.3.0/mkmf.rb:587:in `try_cpp'
    from /usr/lib/ruby/2.3.0/mkmf.rb:1091:in `block in have_header'
    from /usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
    from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
    from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from /usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
    from /usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
    from /usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
    from /usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
    from /usr/lib/ruby/2.3.0/mkmf.rb:1090:in `have_header'
    from extconf.rb:16:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.14/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.14 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.14/gem_make.out
Successfully installed bundler-1.13.6
Parsing documentation for bundler-1.13.6
Done installing documentation for bundler after 7 seconds
1 gem installed

以下是日志文件中的内容:

package configuration for libffi is not found
"gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.3.0 -I/usr/include/ruby-2.3.0/ruby/backward -I/usr/include/ruby-2.3.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic     -lruby-2.3  -lpthread -lgmp -ldl -lcrypt -lm   -lc"
In file included from /usr/include/ruby-2.3.0/ruby/ruby.h:36:0,
                 from /usr/include/ruby-2.3.0/ruby.h:33,
                 from conftest.c:1:
/usr/include/ruby-2.3.0/ruby/defines.h:26:19: fatal error: stdio.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

我正在运行Linux Mint,我找不到任何可以解决此问题的方法。安装了一个jekyll宝石,我可以创建jekyll项目,但只能部分创建,我无法在本地主机上运行并编辑它。

有任何问题让我知道,我会尽力帮助提供详细信息。

1 个答案:

答案 0 :(得分:0)

我在Linux Mint上遇到了同样的问题18.安装build-essential解决了它:

"use strict";

let azureMobileApps = require('azure-mobile-apps');
let table = azureMobileApps.table();
let insertMiddleware = function(req,res,next){
    let t = req.azureMobile.tables('TodoItem');
    let items = req.azureMobile.item;
    let query = queries.create('TodoItem');
    if(items.length>1){
      let inserted=0;
      for(let i in items){
        t.insert(items[i]).then(function(result){
          console.log(result)
          if(result.id){
            inserted++;
          }
          if(i == items.length-1){
            res.json("finished");
          }
        })
      }
    }else{
      next();
    }
};
table.insert.use(insertMiddleware, table.operation);
// CREATE - add or overwrite the userId based on the authenticated user
table.insert(function (context) {
  return context.execute();
});