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.

gem dependencies broken in 2.1.0

#293

whatever gem i want to include in my enviroment.rb:

config.gem "some_existing_gem"

i always get:

http://pastie.caboo.se/206810

when i do:

rake gems:install, i always get:

http://pastie.caboo.se/206812

looks like gem dependencies are broken.

Reported by Piotr Nowak · June 1st, 2008 @ 06:06 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Alex MacCaw
    Alex MacCaw

    I think you'll find it's gchartrb's silly gem naming.

    Try:

    config.gem "gchartrb", :lib => "google_chart"

    June 1st, 2008 @ 07:21 PM

  2. Piotr Nowak
    Piotr Nowak

    nope, every gem i use cause the same error.

    June 1st, 2008 @ 07:25 PM

  3. Alex MacCaw
    Alex MacCaw

    You get exactly the same error? Or one relating to the actual gem?

    June 1st, 2008 @ 07:28 PM

  4. Piotr Nowak
    Piotr Nowak

    not exactly the same.

    the error message contains gem related to that one mentioned in enviroment.rb.

    so when i use config.gem 'RedCloth' i get RedCloth gem error, when i use 'mislav-will_paginate' gem i get mislav-will_paginate respectively.

    this error is confirmed with couple people on irc 2 hours ago.

    June 1st, 2008 @ 07:33 PM

  5. Alex MacCaw
    Alex MacCaw

    Hmm, working fine for me with 2.1.0 with all gems you mentioned. Not sure what the problem is.

    June 1st, 2008 @ 07:48 PM

  6. Piotr Nowak
    Piotr Nowak

    mhmm strange.

    we can't make rails 2.1.0 work with any gem..

    June 1st, 2008 @ 07:53 PM

  7. invalidsusrname
    invalidsusrname

    I'm also seeing similar errors happening on an ubuntu machine.

    http://pastie.caboo.se/206869

    running on ruby 1.8.6 (2007-06-07 patchlevel 36) [i486-linux] and rails 2.1

    Strangely, I did not notice this when using OSX.

    June 1st, 2008 @ 08:48 PM

  8. Alex MacCaw
    Alex MacCaw

    What gem version are you using?

    Can you send me a copy of your rails environment?

    June 1st, 2008 @ 08:52 PM

  9. invalidsusrname
    invalidsusrname

    Attached my environment.rb. Here's a printout of what script/about knows (I had to comment out the config.gem lines to get this to show up

    $ ./script/about

    About your application's environment

    Ruby version 1.8.6 (i486-linux)

    RubyGems version 1.1.1

    Rails version 2.1.0

    Active Record version 2.1.0

    Action Pack version 2.1.0

    Active Resource version 2.1.0

    Action Mailer version 2.1.0

    Active Support version 2.1.0

    Application root XXX/projects/YY

    Environment development

    Database adapter sqlite3

    Database schema version 4

    June 1st, 2008 @ 09:02 PM

  10. invalidsusrname
    invalidsusrname

    Guess safari didn't upload the attachment. Trying with Firefox

    June 1st, 2008 @ 09:04 PM

  11. Piotr Nowak
    Piotr Nowak

    im using ubuntu 8.04

    About your application's environment

    Ruby version 1.8.6 (x86_64-linux)

    RubyGems version 1.1.1

    Rails version 2.1.0

    Active Record version 2.1.0

    Action Pack version 2.1.0

    Active Resource version 2.1.0

    Action Mailer version 2.1.0

    Active Support version 2.1.0

    Application root /home/pnowak/workspace/ruby/tripmate

    Environment development

    Database adapter sqlite3

    Database schema version 20080601092839

    June 1st, 2008 @ 10:17 PM

  12. Piotr Nowak
    Piotr Nowak

    well, anyone has similar issues ?

    June 2nd, 2008 @ 11:09 AM

  13. Alex MacCaw
    Alex MacCaw

    It's working for me under OSX 10.4 and Ubuntu 7.10.

    June 2nd, 2008 @ 11:12 AM

  14. Piotr Nowak
    Piotr Nowak

    problem solved.

    i was trying to run will_paginate but i forgot to use :lib paremater.

    the following example works:

    config.gem "mislav-will_paginate", :lib => "will_paginate"

    why is it so ?

    why i cant use just the gem name from 'gem list' command ?

    cheers

    June 2nd, 2008 @ 09:37 PM

  15. Piotr Nowak
    Piotr Nowak

    problem solved.

    i was trying to run will_paginate but i forgot to use :lib paremater.

    the following example works:

    config.gem "mislav-will_paginate", :lib => "will_paginate"

    why is it so ?

    why i cant use just the gem name from 'gem list' command ?

    cheers

    June 2nd, 2008 @ 09:37 PM

  16. Jacek Becela
    Jacek Becela

    This :lib parameter makes Rails invoke require "will_paginate" instead of (wrong) require "mislav-will_paginate".

    However if you install gems (almost all but those from github which are prefixed with username) which name is the same as the file to require, you will be ok.

    June 2nd, 2008 @ 07:13 PM

  17. Piotr Nowak
    Piotr Nowak

    but should'n this be done internally by some gem descriptor file or sth ?

    why do i have to know inner structure of gem ?

    i, as a gem client, just want to know by typing 'gem list' what is gem name, and then use it in enviroment.rb.

    for me its kind too complicated. what do you think ?

    June 2nd, 2008 @ 07:53 PM

  18. Jacek Becela
    Jacek Becela

    The standard is to have a gem named xxx and a file in the gem at lib/xxx.rb so you always know what to require (by looking at the gem list).

    But then enters the GitHub and some developers who don't obey this rule. GitHub has to do it to differentiate between, say: my fork of your gem and your original gem. So it prefixes it with username.

    You are right that it would be cool if you just required a gem by its name and the main require was invoked automatically. I wonder if developers who included the :lib option in config.gem considered this.

    June 2nd, 2008 @ 08:24 PM

  19. DHH
    DHH
    • State changed from new to invalid

    June 3rd, 2008 @ 04:09 AM

  20. Dusty Doris
    Dusty Doris

    We are seeing the same issue right now on ubuntu 8.04 and not on OSX. However, we are passing the :lib to the gem that needs it. Is anyone else having problems still? Is it possible this ticket is not invalid?

    Thanks.

    config.gem 'mislav-will_paginate',

    :version => ">= 2.3.2",

    :lib => 'will_paginate',

    :source => "http://gems.github.com"

    config.gem 'uuidtools',

    :version => ">= 1.0.3"

    ** Invoke gems (first_time)

    ** Invoke gems:base (first_time)

    ** Execute gems:base

    ** Invoke environment (first_time)

    ** Execute environment

    rake aborted!

    wrong number of arguments (2 for 1)

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/locator.rb:91:in `add'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/locator.rb:91:in `plugins'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:63:in

    `locate_plugins'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:62:in

    `map'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:62:in

    `locate_plugins'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:27:in

    `all_plugins'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:22:in

    `plugins'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/loader.rb:45:in

    `add_plugin_load_paths'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:235:in

    `add_plugin_load_paths'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:116:in

    `process'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `send'

    /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:93:in `run'

    June 11th, 2008 @ 08:42 PM

  21. Dusty Doris
    Dusty Doris

    Sorry, looking through this ticket I see a few things that seem different. I'm referring to the problem shown by invalidsusrname

    at:

    http://pastie.caboo.se/206869

    June 11th, 2008 @ 08:45 PM

  22. invalidsusrname
    invalidsusrname

    Dusty,

    What I discovered running an upgrade from ubuntu 7.04 to 8.04 was that there was two versions of rubygems installed somehow. Rails ended up choosing and older version of Gem::DependencyList. This was causing the wrong number of arguments error for me.

    To solve this, I removed the old version of rubygems from apt-get, reinstalled rubygems from source, and updated my path. Once I did this, the newer version of DependencyList was loaded, and I didn't get any more errors.

    June 11th, 2008 @ 08:55 PM

  23. Dusty Doris
    Dusty Doris

    Great, that was it! I appreciate the feedback.

    Here is a summary.

    short version

    • remove rubygems with apt-get if it was installed that way
    • install rubygems from source

    long version

    The rubygems installed by apt-get, placed the rubygems libraries in /usr/lib. We upgraded to rubygems 1.1.1, using gem update --system, which placed the libraries in /usr/local/lib. We were calling the correct gem binary, but our gem was actually loading the older version of some of the dependencies from /usr/lib.

    Removing rubygems from apt-get, cleared out that old library, just as invalidsusrname indicated. Then, we went ahead and re-installed rubygems from source just to be sure.

    Now all is well.

    Thanks for the update on this.

    June 11th, 2008 @ 09:19 PM

  24. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:55 PM

  25. bingbing