This project is archived and is in readonly mode.

#1891 ✓stale
Tim Lucas

config.gem with multiple sources

Reported by Tim Lucas | February 6th, 2009 @ 12:55 AM | in 2.x

The gem command allows you to specific N sources but GemDependency only allows one.

To install some gems (e.g. aslakhellesoy-cucumber from github) you need to specify multiple gem repositories, such as gems.github.com and gems.rubyforge.org.

The latest patch (see last comment) adds a :sources option to specify multiple sources and improves the config.gem rdoc.

Comments and changes to this ticket

  • John

    John February 6th, 2009 @ 01:11 AM

    +1, small change and a handy feature

  • Chris Lloyd

    Chris Lloyd February 6th, 2009 @ 01:21 AM

    +1 Though the real solution is for either every gem developer to host their gems on Rubyforge, or (more realistically) Rubyforge provide automatic acceptances for name-spaced gems (ala Github).

  • Tim Lucas

    Tim Lucas February 6th, 2009 @ 01:22 AM

    Just noticed attr_accessor :source. Not sure if anybody is using GemDependency directly, or whether it's a supported API.

    I've attached a new patch which removes the source reader accessor and replaces it with sources.

    Even more unsure now whether :source should simply be an alias to :sources and we allow both a single value and an array of values.

  • Tim Lucas

    Tim Lucas February 6th, 2009 @ 02:29 AM

    Attached is a new ticket with updated rdoc for config.gem, as well as making :source and :sources equivalent and consistent.

    The Rails::GemDependency#source accessor has been removed and replaced with #sources

  • Matt Jones

    Matt Jones February 6th, 2009 @ 06:30 AM

    • Assigned user set to “Matt Jones”

    This is caused by the --source option to gem install ignoring any other sources configured by the system when installing dependencies. (see also this ticket for Rubygems)

    A different fix would be to include the sources listed from 'gem sources' when invoking 'gem install'. That would solve the most common case (where a gem on github depends on gems hosted on rubyforge).

    It should be easy to add ('gem sources' is basically just a newline-seperated list of URLs) - I'll try to put a patch together this weekend.

  • Tim Lucas

    Tim Lucas February 8th, 2009 @ 05:05 AM

    you think that's really a good idea though? Sounds like a round-about monkey patch to rubygems, something that would be in rails for quite a while. At least my approach is simply the same as what you'd do on the command line and when rubygems is fixed you just update your app's config (if needed)

  • Thomas Watson

    Thomas Watson February 16th, 2009 @ 11:27 AM

    Is this what causes my gems:install to fail when installing a gem from GitHub (using :sources => "http://gems.github.com") that has a regular dependency?

    gem install patientslikeme-campaign_monitor --source http://gems.github.com ERROR: Error installing patientslikeme-campaign_monitor:

    patientslikeme-campaign_monitor requires xml-simple (>= 1.0.11, runtime)
    
    
  • Pratik

    Pratik May 18th, 2009 @ 07:59 PM

    • State changed from “new” to “stale”

    Please reopen if still an issue.

  • Ryan Bigg

    Ryan Bigg October 9th, 2010 @ 09:48 PM

    • Tag cleared.
    • Importance changed from “” to “Low”

    Automatic cleanup of spam.

  • bingbing
  • joson

    joson April 29th, 2011 @ 09:14 AM

    A Replica Breitling is a timepiece of high quality and functionality and you will have all the class, prestige and luxury of a wealthy, successful individual. By choosing from our selection of luxury Replica Watches , you can improve your self-esteem and feel confident to enter new circles of business associates and friends. These Rolex Replicas will surely enhance your style and only you will know the watch you wear did not cost you $1,000's of dollars.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages