Gem Install User Agent String

imjeeves's Avatar

imjeeves

28 Oct, 2013 03:53 PM

Good Morning,

I've searched and found plenty of information on how to set proxy servers when performing "gem installs" but the proxy that I'm behind requires a specific user-agent string (or at least the addition of a specific string). When I run "gem install" without a proxy, I get a timeout error (which is expected). When running with the proxy, I get the below error (a 403 Forbidden is expected if I don't have the correct user agent string):

user@snort02:~$ gem install bundler -V -p http://#.#.#.#:8080
GET http://rubygems.org/latest_specs.4.8.gz
403 Forbidden
Error fetching remote data: bad response Forbidden 403 (http://rubygems.org/latest_specs.4.8.gz)
Falling back to local-only install
ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository
GET http://rubygems.org/latest_specs.4.8.gz
connection reset after 2 requests, retrying
GET http://rubygems.org/latest_specs.4.8.gz
403 Forbidden
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Forbidden 403 (http://rubygems.org/latest_specs.4.8.gz)

Anyway, is there a way to specify a user-agent string for Gems? I'm running Ubuntu 13.10, for what it's worth. Thanks!

  1. Support Staff 1 Posted by Nick Quaranto on 11 Nov, 2013 09:05 PM

    Nick Quaranto's Avatar

    Sounds like there's a firewall or proxy at work here. Is this still happening?

  2. 2 Posted by imjeeves on 11 Nov, 2013 09:13 PM

    imjeeves's Avatar

    Nick,

    With all due respect, please read the post before replying. I very
    explicitly say that there is a proxy involved and that I know that's part
    of the issue. I'm asking if there is a way to specify a user-agent string
    when doing an install.

  3. Support Staff 3 Posted by Nick Quaranto on 11 Nov, 2013 09:43 PM

    Nick Quaranto's Avatar

    Oops, sorry. To my knowledge there is not a way to override it without editing the rubygems source directly:

    https://github.com/rubygems/rubygems/blob/master/lib/rubygems/reque...

    Sorry I can't help more with this.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac