This project is archived and is in readonly mode.

#293 ✓invalid
Piotr Nowak

gem dependencies broken in 2.1.0

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

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.

Comments and changes to this ticket

  • Alex MacCaw

    Alex MacCaw June 1st, 2008 @ 07:21 PM

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

    Try:

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

  • Piotr Nowak

    Piotr Nowak June 1st, 2008 @ 07:25 PM

    nope, every gem i use cause the same error.

  • Alex MacCaw

    Alex MacCaw June 1st, 2008 @ 07:28 PM

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

  • Piotr Nowak

    Piotr Nowak June 1st, 2008 @ 07:33 PM

    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.

  • Alex MacCaw

    Alex MacCaw June 1st, 2008 @ 07:48 PM

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

  • Piotr Nowak

    Piotr Nowak June 1st, 2008 @ 07:53 PM

    mhmm strange.

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

  • invalidsusrname

    invalidsusrname June 1st, 2008 @ 08:48 PM

    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.

  • Alex MacCaw

    Alex MacCaw June 1st, 2008 @ 08:52 PM

    What gem version are you using?

    Can you send me a copy of your rails environment?

  • invalidsusrname

    invalidsusrname June 1st, 2008 @ 09:02 PM

    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

  • invalidsusrname

    invalidsusrname June 1st, 2008 @ 09:04 PM

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

  • Piotr Nowak

    Piotr Nowak June 1st, 2008 @ 10:17 PM

    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

  • Piotr Nowak

    Piotr Nowak June 2nd, 2008 @ 11:09 AM

    well, anyone has similar issues ?

  • Alex MacCaw

    Alex MacCaw June 2nd, 2008 @ 11:12 AM

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

  • Piotr Nowak

    Piotr Nowak June 2nd, 2008 @ 09:37 PM

    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

  • Piotr Nowak

    Piotr Nowak June 2nd, 2008 @ 09:37 PM

    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

  • Jacek Becela

    Jacek Becela June 2nd, 2008 @ 07:13 PM

    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.

  • Piotr Nowak

    Piotr Nowak June 2nd, 2008 @ 07:53 PM

    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 ?

  • Jacek Becela

    Jacek Becela June 2nd, 2008 @ 08:24 PM

    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.

  • DHH

    DHH June 3rd, 2008 @ 04:09 AM

    • State changed from “new” to “invalid”
  • Dusty Doris

    Dusty Doris June 11th, 2008 @ 08:42 PM

    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'

  • Dusty Doris

    Dusty Doris June 11th, 2008 @ 08:45 PM

    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

  • invalidsusrname

    invalidsusrname June 11th, 2008 @ 08:55 PM

    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.

  • Dusty Doris

    Dusty Doris June 11th, 2008 @ 09:19 PM

    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.

  • Ryan Bigg

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

    Automatic cleanup of spam.

  • bingbing

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>

Attachments

Pages