Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Bundle install dies with "Syntax error: Unterminated quoted string" with config options #3053

Closed
afair opened this issue May 30, 2014 · 4 comments

Comments

@afair
Copy link

afair commented May 30, 2014

bundle install with nokogiri on FreeBSD require configure build configuration options:

bundle config build.nokogiri --with-xml2-lib=/usr/local/lib \
    --with-xml2-include=/usr/local/include/libxml2/libxml \
    --with-xslt-lib=/usr/local/lib \
    --with-xslt-include=/usr/local/include/libxslt \
    --with-iconv-lib=/usr/local/lib/ \
    --with-iconv-include=/usr/local/include/

Properly creates ~/.bundle/config


---
BUNDLE_BUILD__NOKOGIRI: "--with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2/libxml
  --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include/libxslt --with-iconv-lib=/usr/local/lib/
  --with-iconv-include=/usr/local/include/"

However, the build died doing a bundle install --deployment

Syntax error: Unterminated quoted string

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/allen/.rubies/ruby-2.1.2/bin/ruby extconf.rb "--with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2/libxml --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include/libxslt --with-iconv-lib=/usr/local/lib/

extconf failed, exit code 2

Note a double-quote at the start of the options, none at the end.

Workaround: I edited the ~/.bundle/config file, removed the quoting, and placed all the options on a single line. Running bundle install --deployment again succeeded.

Probably related to #2469

@indirect
Copy link
Member

ghetto YAML parser: always still too ghetto. :(

On Fri, May 30, 2014 at 1:32 PM, Allen Fair notifications@github.com
wrote:

bundle install with nokogiri on FreeBSD require configure build configuration options:
bundle config build.nokogiri --with-xml2-lib=/usr/local/lib
--with-xml2-include=/usr/local/include/libxml2/libxml
--with-xslt-lib=/usr/local/lib
--with-xslt-include=/usr/local/include/libxslt
--with-iconv-lib=/usr/local/lib/
--with-iconv-include=/usr/local/include/
Properly creates ~/.bundle/config
---
BUNDLE_BUILD__NOKOGIRI: "--with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2/libxml
--with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include/libxslt --with-iconv-lib=/usr/local/lib/
--with-iconv-include=/usr/local/include/"
However, the build died doing a bundle install --deployment
Syntax error: Unterminated quoted string

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /home/allen/.rubies/ruby-2.1.2/bin/ruby extconf.rb "--with-xml2-lib=/usr/local/lib --with-xml2-include=/usr/local/include/libxml2/libxml --with-xslt-lib=/usr/local/lib --with-xslt-include=/usr/local/include/libxslt --with-iconv-lib=/usr/local/lib/

extconf failed, exit code 2

Note a double-quote at the start of the options, none at the end.
Workaround: I edited the ~/.bundle/config file, removed the quoting, and placed all the options on a single line. Running bundle install --deployment again succeeded.

Probably related to #2469

Reply to this email directly or view it on GitHub:
#3053

@kennethkalmer
Copy link

We're seeing the exact same thing:

$ bundle config build.nokogiri --use-system-libraries --with-xml2-lib=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/lib --with-xml2-include=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/include/libxml2 --with-xslt-dir=/nix/store/ynnz7niw4k2lxkhfz32akg543hyaxdbx-libxslt-1.1.28

Which gave this:

$ cat .bundle/config
---
BUNDLE_BUILD__NOKOGIRI: "--use-system-libraries --with-xml2-lib=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/lib
  --with-xml2-include=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/include/libxml2
  --with-xslt-dir=/nix/store/ynnz7niw4k2lxkhfz32akg543hyaxdbx-libxslt-1.1.28"

Which lead to this:

$ bundle config
Settings are listed in order of priority. The top value will be used.
build.nokogiri
Set for the current user (.bundle/config): "'--use-system-libraries --with-xml2-lib=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/lib --with-xml2-include=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/include/libxml2"

Looking very closely, there is a an extra single quote at the beginning of the list of flags. This wasn't causing the syntax error, but it did lead to this error:

Using mini_portile 0.6.2
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /nix/store/pzpr5sa0qs9inak6968jz5irwg54l7sb-ruby-2.2.0-p0/bin/ruby -r ./siteconf20150225-92883-1tyf464.rb extconf.rb '--use-system-libraries --with-xml2-lib=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/lib --with-xml2-include=/nix/store/pzviwzzjnld1lrjy9wwgiwciln2c935h-libxml2-2.9.2/include/libxml2

extconf failed, exit code 2

This is on Ruby 2.2.0 on OSX, with ZSH 5 Anything we can do to help fix this, even if we need to lobby for fixes upstream?

@indirect
Copy link
Member

@kennethkalmer this should be fixed in the latest version of Bundler, although you may have to delete your ~/.bundle/config file and set the setting again after gem install bundler to get the latest version.

@fulldecent
Copy link

What version was this fixed in?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants