#251 ✓resolved
Chad Woolley

Do you still need activesupport as a gem dependency? It breaks stuff...

Reported by Chad Woolley | October 30th, 2008 @ 01:58 AM

I see this ticket:


And this commit:


I'm wondering if we can remove it safely now, because it causes us problems.

Here is our specific problem:

  • We explicitly activate all gem versions before rails initializes (via config/preinitializer.rb).

  • We sometimes activate an older version of rails than is installed on the box (e.g. app is still using rails 2.1.0 but 2.1.1 is installed as well)

  • If mislav-will_paginate is activated before rails (which happens if you go in alphabetical order), the highest version of activesupport (2.1.1) will be activated. This causes the subsequent activation of rails 2.1.1 to fail, because rails 2.1.0 tries to activate activesupport 2.1.0, which fails because you can only activate one version of a gem at a time.

Since will_paginate can only operate in the context of Rails, it doesn't seem to make sense for it to explicitly define a sub-dependency of rails as one of its dependencies.

So, unless there is a reason to keep this dependency, can we remove it?

Thanks, -- Chad

Comments and changes to this ticket

  • Mislav

    Mislav October 30th, 2008 @ 10:12 AM

    • State changed from “new” to “resolved”

    Your last point is valid. The gem dependency only caused problems. Although you shouldn't load will_paginate before Rails! Then you need an extra WillPaginate::enable after the framework loads.

    See e548631. Github should rebuild the gem shortly.

  • Chad Woolley

    Chad Woolley October 30th, 2008 @ 10:26 AM

    Thanks for the prompt response.

    Not sure about the "enable" comment, though.

    We only activate the gems in preinitializer, which means calling the rubygems 'gem' method to put the gems' specified entries on the load path.

    They don't get required until the normal will_paginate require call in the initializer/environment.rb.

    So, it shouldn't matter what order they are activated in, or put on the load path, as long as they are required in the correct order. At least, I think this should be the case unless some very bad un-namespaced promiscuous monkey-patching is going on. Right?

  • Mislav

    Mislav October 30th, 2008 @ 12:24 PM

    Oh, I missed that you said "activate your gems" instead of "require". All is well ;)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

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

Everyone's favorite Ruby library for pagination of practically anything!

People watching this ticket