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 ruby executable path resolution on Windows #15

Merged
merged 1 commit into from
Mar 18, 2016
Merged

Conversation

vais
Copy link
Contributor

@vais vais commented Mar 18, 2016

While it's OK to use forward slashes in the executable path on Windows when invoking the executable directly, it does cause issues in some of the more complex use cases, such as when the executable path is used as part of a command pipeline, e.g.:

C:\Users\Administrator>echo puts "hello" | C:/Ruby/ruby-2.2.4-i386-mingw32/bin/ruby.exe
'C:' is not recognized as an internal or external command,
operable program or batch file.

Replacing / with \ in the executable path solves this problem:

C:\Users\Administrator>echo puts "hello" | C:\Ruby\ruby-2.2.4-i386-mingw32\bin\ruby.exe
hello

Making this change fixes a number of failures running ruby/spec on Windows.

@eregon
Copy link
Member

eregon commented Mar 18, 2016

Thank you for the analysis and the patch 😃 , merged!

eregon added a commit that referenced this pull request Mar 18, 2016
Fix ruby executable path resolution on Windows
@eregon eregon merged commit f90efa0 into master Mar 18, 2016
@vais vais deleted the vais/windows branch March 19, 2016 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants