Gem Install User Agent String

imjeeves's Avatar


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
403 Forbidden
Error fetching remote data: bad response Forbidden 403 (
Falling back to local-only install
ERROR: Could not find a valid gem 'bundler' (>= 0) in any repository
connection reset after 2 requests, retrying
403 Forbidden
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
    bad response Forbidden 403 (

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


    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:

    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


? 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