简体   繁体   中英

Ruby Gem server not serving gems?

I am trying to make a new acceptance agent for teamcity...I followed this article http://docs.rubygems.org/read/chapter/18 ...

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-1.0.0.9250...

I don't know the mime-type for .gem extension so I just put application/x-ruby-gem. Although manually when I put machinename:910/gems/Gem_Name I am able to download it.

but when i use bundle install it gives below error

Fetching source index for http://gems.github.com/
Fetching source index for my server url
Could not reach rubygems repository http://gems.github.com/, my server url:
910/, http://rubygems.org/
Fetching source index for http://rubygems.org/
Could not find gem 'activerecord-sqlserver-adapter (= 1.0.0.9250, runtime)' in a
ny of the gem sources listed in your Gemfile.

Please find below Gemfile.

source "http://computerName:910/"
source :gemcutter

gem 'rake', '0.8.7'
gem 'cucumber', '0.6.2'
gem 'watir', '1.6.5'
gem 'activerecord', '2.3.8'
gem 'activerecord-sqlserver-adapter', '1.0.0.9250'
gem 'rspec', '1.3.0'
gem 'parseexcel', '0.5.2'
gem 'win32-api', '1.4.5'
gem 'nokogiri', '1.4.1'
gem 'win32-eventlog', '0.5.2'
gem 'win32console'

I don't know the mime-type for .gem extension so I just put application/x-ruby-gem. Although manually when I put machinename:910/gems/Gem_Name I am able to download it.

Your gem client is complaining that the source index can't be reached, not the gem itself.

In the article you linked to, item 4.2.4 instructs:

Run the generate_index gem command in order to generate the yaml and yaml.Z files needed by the RubyGems client.

Make sure generate_index created the yaml and yaml.Z files in your gems directory. Check if they are accessible. This is the source index that your gems client is looking for.

For example, GitHub's gem source index file is located here: http://gems.github.com/gems/yaml

  1. Use the ip address instead of computername and see if that fixes your 504 problem

  2. Now try to update your gems, if you get a 404 error when trying to access a folder called /quick then run the generate_index command with the --legacy option

gem generate_index --legacy
  1. Add .rz mimetype to your IIS so that it can serve the rzip files. In IIS mime types, add the following mapping:

.rz -> application/x-rzip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM