How do you get bundle config to use multiple build options?

Viewed 764

I'm attempting to use bundler to install some packages, the command I want to use is:

bundle install --path vendor/bundle

However, since libxml2 is being a jerk, I need to setup the config before hand with a command like so:

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

But when I look at the .bundle/config file, I see:

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

You'll notice the dir2, dir3, and dir4 appear on the next line, not on the same line as the dir1. This is a problem because when I type bundle config to display the current config, I see that it isn't recognizing second line of configs:

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"

How do I get bundle config to retain multiple build options? FYI, I already tried putting quotes around them, and removing the --local -- they yielded the same result.

I'm using bundler version 1.3.5

1 Answers

In my case (bundler-1.17.2, bundler-2.0.2) it was passing all the arguments as one:

$ 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

That's a known issue, that was fixed in bundler-2.1.0.pre.1 and will supposedly lend into bundler-2.1.0.

Related