【问题标题】:How do you get bundle config to use multiple build options?您如何获得捆绑配置以使用多个构建选项?
【发布时间】:2013-12-29 22:37:22
【问题描述】:

我正在尝试使用 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 config 保留多个构建选项?仅供参考,我已经尝试在它们周围加上引号,并删除 --local - 它们产生了相同的结果。

我使用的是捆绑器版本 1.3.5

【问题讨论】:

    标签: bundle bundler config options gem-bundler


    【解决方案1】:

    在我的例子中(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,它是bundler-2.1.0.pre.1 中的fixed,据说会借给bundler-2.1.0

    【讨论】:

      猜你喜欢
      • 2023-04-09
      • 1970-01-01
      • 1970-01-01
      • 2020-01-07
      • 2014-01-01
      • 2010-11-24
      • 2020-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多