Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

config.gem with multiple sources

#1891

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.

Reported by Tim Lucas · February 6th, 2009 @ 12:55 AM

State: stale
Milestone: 2.x
Assigned to: Matt Jones Matt Jones
Importance: Low

Activity

  1. John
    John

    +1, small change and a handy feature

    February 6th, 2009 @ 01:11 AM

  2. Chris Lloyd
    Chris Lloyd

    +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).

    February 6th, 2009 @ 01:21 AM

  3. Tim Lucas
    Tim Lucas

    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.

    February 6th, 2009 @ 01:22 AM

  4. Tim Lucas
    Tim Lucas

    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

    February 6th, 2009 @ 02:29 AM

  5. Matt Jones
    Matt Jones
    • 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.

    February 6th, 2009 @ 06:30 AM

  6. Tim Lucas
    Tim Lucas

    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)

    February 8th, 2009 @ 05:05 AM

  7. Thomas Watson
    Thomas Watson

    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)
    
    

    February 16th, 2009 @ 11:27 AM

  8. Pratik
    Pratik
    • State changed from new to stale

    Please reopen if still an issue.

    May 18th, 2009 @ 07:59 PM

  9. Ryan Bigg
    Ryan Bigg
    • Tag cleared.
    • Importance changed from to Low

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:48 PM

  10. bingbing
  11. joson
    joson

    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.

    April 29th, 2011 @ 09:14 AM