Skip to content
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

Gem installation fails if install path contains a space #2054

Closed
richard-viney opened this issue Jul 16, 2020 · 4 comments
Closed

Gem installation fails if install path contains a space #2054

richard-viney opened this issue Jul 16, 2020 · 4 comments

Comments

@richard-viney
Copy link

Gem installation fails if the installation path contains a space. This may be a slightly more general problem that extends to all characters that require shell escaping.

To Reproduce

mkdir "path with space"
cd "path with space"
echo "source 'https://rubygems.org'\ngem 'nokogiri'" > gems.rb
bundle config --local path 'vendor'
bundle install

The relevant lines in the output are

Running 'configure' for libxml2 2.9.10... OK
Running 'compile' for libxml2 2.9.10... OK
Running 'install' for libxml2 2.9.10... ERROR

And in the install.log:

Making install in .
 /usr/local/bin/gmkdir -p '/Users/Richard/Desktop/path with space/vendor/ruby/2.5.0/gems/nokogiri-1.10.10/ports/x86_64-apple-darwin19.4.0/libxml2/2.9.10/lib'
 /bin/sh ./libtool   --mode=install /usr/local/bin/ginstall -c   libxml2.la '/Users/Richard/Desktop/path with space/vendor/ruby/2.5.0/gems/nokogiri-1.10.10/ports/x86_64-apple-darwin19.4.0/libxml2/2.9.10/lib'
libtool: install: /usr/local/bin/ginstall -c .libs/libxml2.lai /Users/Richard/Desktop/path with space/vendor/ruby/2.5.0/gems/nokogiri-1.10.10/ports/x86_64-apple-darwin19.4.0/libxml2/2.9.10/lib/libxml2.la
ginstall: target 'space/vendor/ruby/2.5.0/gems/nokogiri-1.10.10/ports/x86_64-apple-darwin19.4.0/libxml2/2.9.10/lib/libxml2.la' is not a directory

Looking at the output it's possible that the underlying problem may be in libxml2.

Expected behavior

The bundle install succeeds.

Environment

Ruby 2.5.8
Nokogiri 1.10.10
macOS 10.15.5

@richard-viney richard-viney changed the title Gem installation in path containing a space Gem installation fails if install path contains a space Jul 16, 2020
@flavorjones
Copy link
Member

flavorjones commented Jul 16, 2020

Hi! Thanks for asking this question. This is actually an issue with libxml2's tooling, which uses libtool and a Makefile that don't support spaces. Prior issues around this include #1407, #1427, #1289, #1175, and #1891.

You could work around this by installing with the "systems library" option, using your distro's libxml2 and libxslt. Check out https://nokogiri.org/tutorials/installing_nokogiri.html for help with that.

I've opened https://github.com/sparklemotion/nokogiri/issues/2055 to call for documenting this as a "known issue".

Given that this is an upstream issue with libxml2 and its toolchain, I'm going to close this issue. I'm sorry we can't be of more help.

@richard-viney
Copy link
Author

Thanks, and sorry for the duplicate report.

If Nokogiri could detect this when being installed and print a "not supported" error that would be great.

I had a quick look over at https://gitlab.gnome.org/GNOME/libxml2 and couldn't see an open issue relating to this limitation. Would it be worth opening one, or is it perhaps just not something they intend to support?

@flavorjones
Copy link
Member

Thanks for offering to open a ticket -- yes, I think it would be worth it. The old tracker (Gnome's bugzilla) had one, but they're in a weird state now where tickets in the old tracker are still open, but haven't been migrated or gotten any attention for the past year or two.

@richard-viney
Copy link
Author

A libxml2 issue has been opened: https://gitlab.gnome.org/GNOME/libxml2/-/issues/176.

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

No branches or pull requests

2 participants