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

Fix installing in path containing spaces #94

Closed
wants to merge 1 commit into from

Conversation

fson
Copy link

@fson fson commented Mar 14, 2018

Installing to any directory with spaces in the path failed because of GEM_HOME and GEM_PATH having not enough quotes around them and ruby failing to parse the options from RUBYOPT when the -r option had spaces in it.

Fixed this by adding the necessary escapes to add doublequotes around the env variables and moved restore_environment.rb to the lib/ruby/site_ruby/ folder, which is in the ruby load path, so the -r option doesn't need to reference the full absolute path.

Fixes #38.

Installing to any directory with spaces in the path failed because of
GEM_HOME and GEM_PATH having not enough quotes around them and ruby
failing to parse the options from RUBYOPT when the -r option had spaces
in it.

Fixed this by adding the necessary escapes to add doublequotes around
the env variables and moved restore_environment.rb to the
lib/ruby/site_ruby/ folder, which is in the ruby load path, so the -r
option doesn't need to reference the full absolute path.

Fixes phusion#38.
fson added a commit to expo/expo-cli that referenced this pull request Aug 16, 2018
…ath with spaces

traveling-ruby failed to run when installed in a directory with spaces
in the path. (See: phusion/traveling-ruby#38)

Worked around this by adding the necessary escapes for quotes with `sed`
in the build script.

Also opened a PR with a proper upstream fix:
phusion/traveling-ruby#94
fson added a commit to expo/expo-cli that referenced this pull request Aug 23, 2018
…ath with spaces

traveling-ruby failed to run when installed in a directory with spaces
in the path. (See: phusion/traveling-ruby#38)

Worked around this by adding the necessary escapes for quotes with `sed`
in the build script.

Also opened a PR with a proper upstream fix:
phusion/traveling-ruby#94
@TimothyJones
Copy link

Is there any chance that this could be merged and released? It would be useful to the pact project, as we use travelling ruby quite a bit.

@FooBarWidget
Copy link
Member

@TimothyJones This pull request looks solid. I'll give making a new release a try. It's been a while since I've touched this and both the macOS and the Linux ecosystem have changed, so it'll take a while for me to resetup a development environment.

@FooBarWidget
Copy link
Member

FooBarWidget commented Jan 8, 2021

After days of work, I've finally gotten it to build properly on macOS 10.15. Because the ecosystem has changed so much, I'm forced to upgrade to Ruby 2.4, and to raise the minimum supported macOS version to 10.14.

Next up will be updating Linux support. The main problem there is that CentOS 5 has reached end-of-life, so something must be done about that. I'm thinking about using this opportunity to switch to Holy Build Box, but I'll need to verify whether there are any open issues.

@TimothyJones
Copy link

This is very very much appreciated! Thank you!

I think the Ruby upgrade might actually fix another issue we were having on windows, so that's an added bonus!

@FooBarWidget
Copy link
Member

Correction, macOS gave me more trouble than I thought. Not only did I have to fight System Integrity Protection, various dependencies needed tweaking. Luckily I've been able to solve those troubles. I've documented some of the challenges I've gone through:
https://www.joyfulbikeshedding.com/blog/2021-01-06-the-future-of-traveling-ruby.html
https://www.joyfulbikeshedding.com/blog/2021-01-13-alternative-to-macos-dyld-library-path.html

@FooBarWidget FooBarWidget mentioned this pull request Jan 14, 2021
@FooBarWidget
Copy link
Member

FooBarWidget commented Jan 24, 2021

I've released a couple of new Holy Build Box versions which solved various issues and modernizes the build environment.

With that over, it's time to get back to updating the Linux version of Traveling Ruby.

@FooBarWidget
Copy link
Member

The Linux and Windows versions have been updated too. The next version of Traveling Ruby is now releasable. I'll merge in this PR. Thanks @fson.

@FooBarWidget FooBarWidget changed the base branch from master to main February 4, 2021 16:04
FooBarWidget added a commit that referenced this pull request Feb 4, 2021
Installing to any directory with spaces in the path failed because of GEM_HOME and GEM_PATH having not enough quotes around them and ruby failing to parse the options from RUBYOPT when the -r option had spaces in it.

Fixed this by adding the necessary escapes to add doublequotes around the env variables and moved restore_environment.rb to the lib/ruby/site_ruby/ folder, which is in the ruby load path, so the -r option doesn't need to reference the full absolute path.

Closes #38.

Contributed by Ville Immonen (@fson) in #94.
@FooBarWidget
Copy link
Member

@TimothyJones 20210206 is now released.

@TimothyJones
Copy link

TimothyJones commented Feb 5, 2021 via email

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

Successfully merging this pull request may close these issues.

Seems to be an issue if there is a space anywhere in the file path of the directory
4 participants