Gem Server is not serving gems

kamran.pervaiz's Avatar


16 Nov, 2012 11:18 AM

hi Guys,

I am trying to make a new acceptance agent for teamcity...I followed this article

I created a website in IIS called gemserver and having a port 910. it has gems folder which has ancient gems like activerecord-sqlserver-adapter-

I dont know the mime-type for .gem extension so I just put application/x-ruby-gem. Although manually when i put http://machinename:910/gems/ i am able to dowload it.

but when i use bundle install it gives below error

Fetching source index for
Fetching source index for http://WGB01AP1128:910/
Could not reach rubygems repository, http://WGB01AP1128:
Fetching source index for
Could not find gem 'activerecord-sqlserver-adapter (=, runtime)' in a
ny of the gem sources listed in your Gemfile.

  1. 1 Posted by kamran.pervaiz on 16 Nov, 2012 11:22 AM

    kamran.pervaiz's Avatar

    seocondly when i use generate_index it does not generate yaml and yaml.Z but it is already there because i just copied it from other server. Other acceptance agents are working fine but this one is giving errors unfortunately :(

  2. 2 Posted by kamran.pervaiz on 23 Nov, 2012 10:39 AM

    kamran.pervaiz's Avatar

    anyone want to reply please?

  3. Support Staff 3 Posted by Eric Hodel on 23 Nov, 2012 08:20 PM

    Eric Hodel's Avatar

    yaml and yaml.Z are no longer necessary.

    Please show the output of gem generate_index -V and gem install -V gem_on_your_server

  4. 4 Posted by kamran.pervaiz on 26 Nov, 2012 10:01 AM

    kamran.pervaiz's Avatar

    Sorry for late reply please find attached the output. The thing is I have ruby installed on my local computer but it is not installed on the Gem server because it is not needed I guess. I do "gem generate_index" on my localhost and copy the folder to that system.

    Could you please tell me how to setup in IIS? I use "application/x-ruby-gem" Mime type but gem install -V gem_server is giving could not find a valid gem?

  5. Support Staff 5 Posted by Eric Hodel on 26 Nov, 2012 07:22 PM

    Eric Hodel's Avatar

    I'm confused about your expectations.

    You haven't added any gems to the gem server:

    Generating Marshal quick index gemspecs for 0 gems

    Without adding gems to the server it's useless.

    Additionally you haven't tried to install gems from this server. http://WGB01AP1128:910/ is not a gem name. You need to set it as a source (--source) instead. Since you haven't added any gems to the server no gem can be installed, though.

  6. 6 Posted by kamran.pervaiz on 27 Nov, 2012 10:11 AM

    kamran.pervaiz's Avatar

    I just followed the below article.

    Could you please let me know the steps how to add gems, yaml and yaml.z. Please find attached the list of files in the gem server.

    when you say you have not added gems what do you mean? Above article says that all you need is to add a folder called gems and paste all the gems in it.
    Is it possible to have a steps or article to follow?

  7. 7 Posted by kamran.pervaiz on 27 Nov, 2012 03:12 PM

    kamran.pervaiz's Avatar

    One more thing when i do generate_index it does not create yaml and yaml.z files. I am not sure why?

  8. 8 Posted by kamran.pervaiz on 27 Nov, 2012 03:25 PM

    kamran.pervaiz's Avatar

    find below the attache file when i did
    gem install -v gem_name --source mygemserver

  9. 9 Posted by kamran.pervaiz on 27 Nov, 2012 03:47 PM

    kamran.pervaiz's Avatar

    I have run the command gem generate_index -d path on the server after installing ruby and here is the log file for that but when i run the gem install gives same error 504 blah blah...

  10. Support Staff 10 Posted by Eric Hodel on 27 Nov, 2012 06:37 PM

    Eric Hodel's Avatar

    Unless you need to support RubyGems before version 1.2 yaml.Z is not needed. The documentation may be outdated.

    Since you are getting 5XX errors, it seems that the problem lies with your web server. Your output from gem generate_index indicates the correct files were created. Please check your server settings. Unfortunately, I can't help you with that.

  11. 11 Posted by kamran.pervaiz on 28 Nov, 2012 10:08 AM

    kamran.pervaiz's Avatar

    Eric, when I type file in browser I can download the file but only in command prompt it is saying that 504 bad response...Any Idea?

  12. 12 Posted by kamran.pervaiz on 29 Nov, 2012 05:30 PM

    kamran.pervaiz's Avatar

    is this a valid command at all because fiddler is not showing anything...

    gem install -V activerecord-sqlserver-adapter- --source http://WGB01AP1128:910/

  13. Support Staff 13 Posted by Eric Hodel on 29 Nov, 2012 06:32 PM

    Eric Hodel's Avatar

    run gem install … with -V then cut and paste the URL that gave 504 or 503 into your browser. Does it succeed?

    What is fiddler?

    Note that activerecord-sqlserver-adapter- is not a valid gem name.

    I think you want gem install -V activerecord-sqlserver-adapter -v --source http://WGB01AP1128:910/

  14. 14 Posted by kamran.pervaiz on 30 Nov, 2012 12:47 PM

    kamran.pervaiz's Avatar

    fiddler shows http traffic from the box it is installed...

    I tried your command and it is still giving same error. when I cut and paste http://WGB01AP1128:910/latest_specs.4.8.gz in the browser it does download the file...I am not sure what is going on...

    C:\Windows\system32>gem install -V activerecord-sqlserver-adapter -v --source http://WGB01AP1128:910/
    302 Moved Temporarily
    200 OK
    GET http://WGB01AP1128:910/specs.4.8.gz
    504 Gateway Time-out
    Error fetching remote data:             bad response Gateway Time-out 504 (http://WGB01AP1128:910/specs.4.8.gz)
    Falling back to local-only install
    ERROR:  Could not find a valid gem 'activerecord-sqlserver-adapter' (= in any repository
    302 Moved Temporarily
    200 OK
    GET http://WGB01AP1128:910/latest_specs.4.8.gz
    504 Gateway Time-out
    ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
        bad response Gateway Time-out 504 (http://WGB01AP1128:910/latest_specs.4.8.gz)
  15. Support Staff 15 Posted by Eric Hodel on 30 Nov, 2012 10:00 PM

    Eric Hodel's Avatar

    Does your web browser use a proxy server to connect? If so, you need to configure RubyGems to use it.

    I'm not sure what to do if not. This apparently is a bug of your web server, so you will have to contact someone else for help.

  16. 16 Posted by kamran.pervaiz on 06 Dec, 2012 09:43 AM

    kamran.pervaiz's Avatar

    I have finally managed to solve it.

    1. Use the IP address of the computer rather than computer name e.g.

    2. .gz and .rz Mime types were missing from the IIS i.e.
      .gem (application/x-ruby-gem) .rz (application/x-rzip)

    3. delete Gemfile.lock and try bundle install.

    Hope this helps.

  17. Nick Quaranto closed this discussion on 19 Dec, 2012 01:36 AM.

Comments are currently closed for this discussion. You can start a new one.

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