【发布时间】:2016-06-20 23:32:05
【问题描述】:
我正在尝试为rails 构建一个bundlerEnv。不知何故,Nix 知道 nokogiri(rails 的依赖项)需要 zlib、libxml2 和 libxslt,但编译失败。
#Gemfile
gem "rails"
#default.nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
bundlerEnv {
name = "smt";
inherit ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
}
$ nix-build
...
buildFlags: --use-system-libraries --with-zlib-dir=/nix/store/dn9l2kd6ai731k34pzlzr5dz3in0rn31-zlib-1.2.8-dev --with-xml2-lib=/nix/store/9w15hz68wz5qnihfhsbr281d0sfs20a8-libxml2-2.9.3/lib --with-xml2-include=/nix/store/rq94vzxa92p30prfgv9jz83xiy8hkn2k-libxml2-2.9.3-dev/include/libxml2 --with-xslt-lib=/nix/store/fv137j5wxp4dg1wjqdbk8i2l087163b7-libxslt-1.1.28/lib --with-xslt-include=/nix/store/j7y29aggnzmlgh5bccp9f7vmiknh16fm-libxslt-1.1.28-dev/include --with-exslt-lib=/nix/store/fv137j5wxp4dg1wjqdbk8i2l087163b7-libxslt-1.1.28/lib --with-exslt-include=/nix/store/j7y29aggnzmlgh5bccp9f7vmiknh16fm-libxslt-1.1.28-dev/include
WARNING: You build with buildroot.
Build root: /
Bin dir: /nix/store/z26mymfryhqqh7y8w94qr0xc88q46dvr-ruby2.3.1-p0-nokogiri-1.6.8/lib/ruby/gems/2.3.1/bin
Gem home: /nix/store/z26mymfryhqqh7y8w94qr0xc88q46dvr-ruby2.3.1-p0-nokogiri-1.6.8/lib/ruby/gems/2.3.1
...
*** 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.
不幸的是,运行find /nix -name mkmf.log 失败。但是使用 Nix 环境手动配置nokogiri 成功(detais)
【问题讨论】:
-
sample rails conf 和 an issue with gitlab 基本上是在做同样的事情,但显然没有这个问题。
-
将
nokogiri从 1.6.8 降级到 1.6.7 解决了这个问题。