config - 如何获取 bundle 配置以使用多个构建选项?

标签 config bundle bundler

我正在尝试使用bundler来安装一些软件包,我想使用的命令是:

bundle install --path vendor/bundle

但是,自从 libxml2 is being a jerk ,我需要使用如下命令预先设置配置:

bundle config --local build.nokogiri --with-xml2-include=dir1 --with-xml2-lib=dir2 --with-xslt-include=dir3 --with-xslt-lib=dir4

但是当我查看 .bundle/config 文件时,我看到:

BUNDLE_BUILD__NOKOGIRI: --with-xml2-include=dir1
  --with-xml2-lib=dir2 --with-xslt-include=dir3 --with-xslt-lib=dir4

您会注意到 dir2dir3dir4 出现在下一行,而不是与 在同一行>dir1。这是一个问题,因为当我输入 bundle config 来显示当前配置时,我发现它无法识别第二行配置:

Settings are listed in order of priority. The top value will be used.
build.nokogiri
Set for your local app (/path/app/.bundle/config): "--with-xml2-include=dir1"

如何获取 bundle 配置以保留多个构建选项?仅供引用,我已经尝试在它们周围加上引号,并删除 --local ——它们产生了相同的结果。

我使用的是 bundle 程序版本 1.3.5

最佳答案

就我而言(bundler-1.17.2bundler-2.0.2),它将所有参数作为一个传递:

$ bundle config --local build.openssl \
--with-openssl-lib=/usr/lib/openssl-1.0 \
--with-openssl-include=/usr/include/openssl-1.0
$ bundle install

$BUNDLE_PATH/ruby/2.6.0/extensions/x86_64-linux/2.6.0-static/openssl-2.0.0/gem_make.out:

/home/yuri/.rubies/ruby-2.6.3/bin/ruby \
-I /home/yuri/.rubies/ruby-2.6.3/lib/ruby/2.6.0 \
-r ./siteconf20191006-3579806-yy73w4.rb extconf.rb \
--with-openssl-lib\=/usr/lib/openssl-1.0\ --with-openssl-include\=/usr/include/openssl-1.0

这是已知的issue ,那就是fixedbundler-2.1.0.pre.1 中,据说会借给 bundler-2.1.0

关于config - 如何获取 bundle 配置以使用多个构建选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20527889/

相关文章:

c# - 在应用程序文件夹外读取单独的 web.config 文件

android - 通过 bundle 将 ViewPager Activity 中的值发送到 Fragment

ruby-on-rails - RVM ruby​​ on rails 问题 OpenSSL

git - bundle 程序错误 : Retrying git cat-file . ..如果此错误仍然存​​在,您可以尝试删除缓存目录

ruby-on-rails - 安装nokogiri(1.6.0)时出错,Bundler无法继续

configuration - 配置文件什么时候成为一种编程语言?

wcf - 无法从http ://localhost:12659获取元数据

grails - 在grails应用程序之间共享resources.groovy

ruby-on-rails - 你的 Ruby 版本是 2.3.0,但是你的 Gemfile 指定了 2.1.2

android - putStringArray() 使用字符串二维数组 (String[][] )