New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
4 participants
@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

This comment has been minimized.

Copy link
Member

indirect commented May 30, 2014

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

This comment has been minimized.

Copy link

kennethkalmer commented Feb 25, 2015

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

This comment has been minimized.

Copy link
Member

indirect commented Feb 25, 2015

@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.

@indirect indirect closed this Feb 25, 2015

@fulldecent

This comment has been minimized.

Copy link

fulldecent commented May 12, 2017

What version was this fixed in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment