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

Git repo URLs not escaped correctly on Windows #1212

Closed
will-s-owen opened this Issue May 31, 2011 · 24 comments

Comments

Projects
None yet
7 participants
@will-s-owen

will-s-owen commented May 31, 2011

tl;dr: double-quote everything on Windows, after replacing double-quotes with two double-quotes

bundle install fails with:
fatal: I don't handle protocol ''https'
Git error: command git clone 'https://github.com/bborn/authlogic.git' "c:/Ruby192/lib/ruby/gems/1.9.1/cache/bundler/git/authlogic-d886115472ee6d482cf48f3e903527ef78df0048" --bare --no-hardlinks in directory c:/Ruby192/apps/communityengine has failed.

This will run fine on the cmd line.

This happens on any and all references to a git repo in gemfiles.

more details here:
https://gist.github.com/1001422

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect May 31, 2011

Member

The git that Bundler is invoking doesn't have support for https URLs. Your PATH must be set up to prioritize a different git binary that does have support.

On May 31, 2011, at 3:36 PM, will-s-owen reply@reply.github.com wrote:

bundle install fails with:
fatal: I don't handle protocol ''https'
Git error: command git clone 'https://github.com/bborn/authlogic.git' "c:/Ruby192/lib/ruby/gems/1.9.1/cache/bundler/git/authlogic-d886115472ee6d482cf48f3e903527ef78df0048" --bare --no-hardlinks in directory c:/Ruby192/apps/communityengine has failed.

This will run fine on the cmd line.

This happens on any and all references to a git repo in gemfiles.

more details here:
https://gist.github.com/1001422

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

Member

indirect commented May 31, 2011

The git that Bundler is invoking doesn't have support for https URLs. Your PATH must be set up to prioritize a different git binary that does have support.

On May 31, 2011, at 3:36 PM, will-s-owen reply@reply.github.com wrote:

bundle install fails with:
fatal: I don't handle protocol ''https'
Git error: command git clone 'https://github.com/bborn/authlogic.git' "c:/Ruby192/lib/ruby/gems/1.9.1/cache/bundler/git/authlogic-d886115472ee6d482cf48f3e903527ef78df0048" --bare --no-hardlinks in directory c:/Ruby192/apps/communityengine has failed.

This will run fine on the cmd line.

This happens on any and all references to a git repo in gemfiles.

more details here:
https://gist.github.com/1001422

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

@will-s-owen

This comment has been minimized.

Show comment
Hide comment
@will-s-owen

will-s-owen May 31, 2011

That would be nice and simple, but I only have one git binary installed.

will-s-owen commented May 31, 2011

That would be nice and simple, but I only have one git binary installed.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect May 31, 2011

Member

As you've probably noticed, the error that you're seeing is actually just Bundler re-raising the error that it got when it shelled out to git with system('git clone ...'). That means, for whatever reason, your git binary is throwing that error. It's not something I can fix by changing Bundler. You might be able to figure out what's going on by patching Bundler to print the path when it shells out to git, or print git --version or something like that.

Member

indirect commented May 31, 2011

As you've probably noticed, the error that you're seeing is actually just Bundler re-raising the error that it got when it shelled out to git with system('git clone ...'). That means, for whatever reason, your git binary is throwing that error. It's not something I can fix by changing Bundler. You might be able to figure out what's going on by patching Bundler to print the path when it shells out to git, or print git --version or something like that.

@indirect indirect closed this May 31, 2011

@will-s-owen

This comment has been minimized.

Show comment
Hide comment
@will-s-owen

will-s-owen Jun 1, 2011

yeah, I did that. It is unilluminating. I reverted to 1.0.13 of bundler and it works just fine.

will-s-owen commented Jun 1, 2011

yeah, I did that. It is unilluminating. I reverted to 1.0.13 of bundler and it works just fine.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 1, 2011

Member

Well, that's at least helpful for narrowing it down... as far as I know, the only change to git between 1.0.13 and 1.0.14 was to escape git URLs more completely, in commit 4fc8385. Does that change break things for you? If it does, is there a different "correct" way to escape single quotes on Windows? Thanks.

Member

indirect commented Jun 1, 2011

Well, that's at least helpful for narrowing it down... as far as I know, the only change to git between 1.0.13 and 1.0.14 was to escape git URLs more completely, in commit 4fc8385. Does that change break things for you? If it does, is there a different "correct" way to escape single quotes on Windows? Thanks.

@indirect indirect reopened this Jun 1, 2011

@lgierth

This comment has been minimized.

Show comment
Hide comment
@lgierth

lgierth Jun 1, 2011

Contributor
fatal: I don't handle protocol ''https'

That actually looks as if git was treating the single-quote as part of the protocol.

Contributor

lgierth commented Jun 1, 2011

fatal: I don't handle protocol ''https'

That actually looks as if git was treating the single-quote as part of the protocol.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 1, 2011

Member

Yep, that appears to be the issue. Looks like we need to implement separate shell-escaping logic on Windows, but I don't know the secret incantations that allow you to quote strings on Windows... can either of you comment on that?

Member

indirect commented Jun 1, 2011

Yep, that appears to be the issue. Looks like we need to implement separate shell-escaping logic on Windows, but I don't know the secret incantations that allow you to quote strings on Windows... can either of you comment on that?

@lgierth

This comment has been minimized.

Show comment
Hide comment
@lgierth

lgierth Jun 1, 2011

Contributor

In think you use double quotes, and escape them by doubling them (yo dawg :>). At least with Win NT 4.0, but I guess it didn't change.

Contributor

lgierth commented Jun 1, 2011

In think you use double quotes, and escape them by doubling them (yo dawg :>). At least with Win NT 4.0, but I guess it didn't change.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 1, 2011

Member

Ow, my brain. Alright, then, we'll just have to adjust the escaping method to check for Windows and use double (double (double)) quotes instead. Thanks for reporting!

Member

indirect commented Jun 1, 2011

Ow, my brain. Alright, then, we'll just have to adjust the escaping method to check for Windows and use double (double (double)) quotes instead. Thanks for reporting!

@ghost ghost assigned indirect Jun 1, 2011

@stalcottsmith

This comment has been minimized.

Show comment
Hide comment
@stalcottsmith

stalcottsmith Jun 1, 2011

Too bad google did not index this yet.

stalcottsmith commented Jun 1, 2011

Too bad google did not index this yet.

@lgierth

This comment has been minimized.

Show comment
Hide comment
@lgierth

lgierth Jun 1, 2011

Contributor

Mmh, looks like escaping changed after NT4: http://stackoverflow.com/questions/2403647/how-to-escape-parameter-in-windows-command-line

So in Win7 you basically escape like in Bash, but always with double quotes. I guess someone with a Windows machine needs to do a bit of testing on this.

Contributor

lgierth commented Jun 1, 2011

Mmh, looks like escaping changed after NT4: http://stackoverflow.com/questions/2403647/how-to-escape-parameter-in-windows-command-line

So in Win7 you basically escape like in Bash, but always with double quotes. I guess someone with a Windows machine needs to do a bit of testing on this.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 1, 2011

Member

Yes, please. Confirmation from a Windows user would be great.

On Jun 1, 2011, at 6:43 AM, lgierth reply@reply.github.com wrote:

Mmh, looks like escaping changed after NT4: http://stackoverflow.com/questions/2403647/how-to-escape-parameter-in-windows-command-line

So in Win7 you basically escape like in Bash, but always with double quotes. I guess someone with a Windows machine needs to do a bit of testing on this.

Reply to this email directly or view it on GitHub:
#1212 (comment)

Member

indirect commented Jun 1, 2011

Yes, please. Confirmation from a Windows user would be great.

On Jun 1, 2011, at 6:43 AM, lgierth reply@reply.github.com wrote:

Mmh, looks like escaping changed after NT4: http://stackoverflow.com/questions/2403647/how-to-escape-parameter-in-windows-command-line

So in Win7 you basically escape like in Bash, but always with double quotes. I guess someone with a Windows machine needs to do a bit of testing on this.

Reply to this email directly or view it on GitHub:
#1212 (comment)

@neebz

This comment has been minimized.

Show comment
Hide comment
@neebz

neebz Jun 2, 2011

still not working for me on Windows 7 using Bundler version 1.0.14. The previous version works fine.

neebz commented Jun 2, 2011

still not working for me on Windows 7 using Bundler version 1.0.14. The previous version works fine.

@will-s-owen

This comment has been minimized.

Show comment
Hide comment
@will-s-owen

will-s-owen Jun 2, 2011

@neebz: I haven't had a chance to try a fix, but if you would like to take a try is it uri_escaped in source.rb.

will-s-owen commented Jun 2, 2011

@neebz: I haven't had a chance to try a fix, but if you would like to take a try is it uri_escaped in source.rb.

@will-s-owen will-s-owen closed this Jun 2, 2011

@betelgeuse

This comment has been minimized.

Show comment
Hide comment
@betelgeuse

betelgeuse Jun 6, 2011

So was a fix for this committed?

betelgeuse commented Jun 6, 2011

So was a fix for this committed?

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 6, 2011

Member

Nope, no fix yet. A patch for the uri_escaped method in lib/bundler/source.rb would be the place to fix it, and you will probably just need to add something like if Bundler::WINDOWS and do Windows escaping instead.

Member

indirect commented Jun 6, 2011

Nope, no fix yet. A patch for the uri_escaped method in lib/bundler/source.rb would be the place to fix it, and you will probably just need to add something like if Bundler::WINDOWS and do Windows escaping instead.

@indirect indirect reopened this Jun 6, 2011

@indirect indirect closed this in 4794327 Jun 9, 2011

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 9, 2011

Member

The fix in 4794327 seems to work for me. Could someone else please test it and let me know if it works for them, too? Thanks.

Member

indirect commented Jun 9, 2011

The fix in 4794327 seems to work for me. Could someone else please test it and let me know if it works for them, too? Thanks.

@will-s-owen

This comment has been minimized.

Show comment
Hide comment
@will-s-owen

will-s-owen Jun 9, 2011

It seems to work for me too.

will-s-owen commented Jun 9, 2011

It seems to work for me too.

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 9, 2011

Member

Great! I'll be releasing a new version of Bundler with this fix (among others) later today. Thanks for testing!

Member

indirect commented Jun 9, 2011

Great! I'll be releasing a new version of Bundler with this fix (among others) later today. Thanks for testing!

@andregabriel

This comment has been minimized.

Show comment
Hide comment
@andregabriel

andregabriel Jun 19, 2011

I have the same dont handle https error. How do I install the previous bundle version 1.0.13?

Thank you.

Regards, Andre.

andregabriel commented Jun 19, 2011

I have the same dont handle https error. How do I install the previous bundle version 1.0.13?

Thank you.

Regards, Andre.

@will-s-owen

This comment has been minimized.

Show comment
Hide comment
@will-s-owen

will-s-owen Jun 19, 2011

The fix mentioned above seems to work fine. Otherwise just 'gem unsintall bundler' and "gem install bundler -v '1.0.13'"

will-s-owen commented Jun 19, 2011

The fix mentioned above seems to work fine. Otherwise just 'gem unsintall bundler' and "gem install bundler -v '1.0.13'"

@indirect

This comment has been minimized.

Show comment
Hide comment
@indirect

indirect Jun 19, 2011

Member

This error is fixed in the newest bundler, 1.0.15. Please see gem help for information on installing gems.

On Jun 19, 2011, at 7:36 AM, andregabriel reply@reply.github.com wrote:

I have the same dont handle https error. How do I install the previous bundle version 1.0.13?

Thank you.

Regards, Andre.

Reply to this email directly or view it on GitHub:
#1212 (comment)

Member

indirect commented Jun 19, 2011

This error is fixed in the newest bundler, 1.0.15. Please see gem help for information on installing gems.

On Jun 19, 2011, at 7:36 AM, andregabriel reply@reply.github.com wrote:

I have the same dont handle https error. How do I install the previous bundle version 1.0.13?

Thank you.

Regards, Andre.

Reply to this email directly or view it on GitHub:
#1212 (comment)

@andregabriel

This comment has been minimized.

Show comment
Hide comment
@andregabriel

andregabriel Jun 20, 2011

Hello, I did installed the latested version everything appeared to went smoothly (no error messages), but after bundle install when I ran rake db:migrate is said: "Could not find kgio-2.1.1 in any of the sources. Try running 'bundlle install'". How can I solve this? Thank you!

andregabriel commented Jun 20, 2011

Hello, I did installed the latested version everything appeared to went smoothly (no error messages), but after bundle install when I ran rake db:migrate is said: "Could not find kgio-2.1.1 in any of the sources. Try running 'bundlle install'". How can I solve this? Thank you!

@andregabriel

This comment has been minimized.

Show comment
Hide comment
@andregabriel

andregabriel Jun 20, 2011

Sorry, there actually was an error within the bundle install. Tks, André.

andregabriel commented Jun 20, 2011

Sorry, there actually was an error within the bundle install. Tks, André.

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