This project is archived and is in readonly mode.

#2672 incomplete
Elia Schito

ActiveSupport gem should depend on builder (and i18n?)

Reported by Elia Schito | May 18th, 2009 @ 04:44 PM | in 2.x

hi pratik,
just found a couple of inconsistencies in active support gem:
it depends on nothing gem but it should depend on (at least) a couple of other gems...

particularly as far as I know it sould depend on "builder" (since it requires balnkslate) and on I18n (which in turn doesn't seem to be available as an independent gem...)

Comments and changes to this ticket

  • Rishav Rastogi

    Rishav Rastogi April 11th, 2010 @ 11:32 PM

    • Assigned user changed from “Pratik” to “Ryan Bigg”

    I think this is taken care of in rails 3. i18n is a separate gem as well now.

    Builder and i18n are installed as dependencies for rails 3 now.

  • Ryan Bigg

    Ryan Bigg April 12th, 2010 @ 12:06 AM

    Is this also taken care of on the 2.3.x branch? I think there's going to be one more 2.3.x release along with 3.0. But I am purely speculating here.

  • Rishav Rastogi

    Rishav Rastogi April 13th, 2010 @ 11:51 PM

    until rails 3, all these dependencies were vendored into the activesupport gem.

    Found at /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.x/lib/active_support/vendor

    I have also checked in 2.3.x.

  • Ryan Bigg

    Ryan Bigg April 14th, 2010 @ 12:10 AM

    • Tag changed from active_support core_ext, activesupport, active_support, builder, dependencies, dependency, dependent, gem, gems, i18n to activesupport
    • State changed from “new” to “invalid”

    Right. Marking as invalid.

  • ravinggenius

    ravinggenius October 8th, 2010 @ 12:20 AM

    • Importance changed from “” to “”

    Please reopen this ticket. I have a Sinatra app that requires Pony (for sending mail). Pony depends on Mail. Mail depends on ActiveSupport. ActiveSupport depends on i18n, but does not declare that fact. Thus, unless I add i18n to my Gemfile, nothing works.

  • Ryan Bigg

    Ryan Bigg October 8th, 2010 @ 12:24 AM

    • State changed from “invalid” to “incomplete”

    Please submit a patch to this ticket to fix this problem.

  • David Haslem

    David Haslem October 20th, 2010 @ 06:04 PM

    Experiencing the same issue - mail depends on activesupport, which doesn't require i18n as it should. Here's a patch moving the i18n dependency from ActiveModel and ActionPack to ActiveSupport, so the dependency can be managed in one place.

  • David Haslem

    David Haslem October 20th, 2010 @ 06:05 PM

    • Tag changed from activesupport to activesupport, patch

    Forgot to add patch tag.

  • Gabe da Silveira

    Gabe da Silveira October 20th, 2010 @ 06:13 PM

    • Tag changed from activesupport, patch to activesupport

    This should be marked invalid. I had this same problem, but it was because the library was requiring active_support/core_ext. I changed it to just require 'active_support' and it works, at least as of this commit: http://github.com/rails/rails/commit/39d6f9e1#diff-21

    Since Rails 3 makes active_support less monolithic, I believe this should be the approved approach going forward. If individual components have specific dependency issues those should be reviewed on a case-by-case basis, however the general claim that active_support does not declare it's dependency of I18n is false.

  • Gabe da Silveira

    Gabe da Silveira October 20th, 2010 @ 06:15 PM

    • Tag changed from activesupport to activesupport, patch

    Uh sorry David, you posted while I was typing :(

    +1 on the patch to fix the gemspec (I already had Rails installed, so didn't notice that aspect of it)

  • David Haslem

    David Haslem October 20th, 2010 @ 06:26 PM

    Previous patch neglected builder, because it looks like it's supposed to be optional for activesupport (builder isn't required until to_xml is called). Here's a patch with both i18n and builder dependency moved into activesupport if you prefer that option.

  • David Haslem

    David Haslem October 20th, 2010 @ 06:42 PM

    No problem Gabe, same happened to me - didn't see your comment until after my second patch :(.

    Your comment makes my second patch unnecessary, since it'd just make active_support more monolithic - only the i18n gem is required to get an 'active_support/core_ext' require to work.

  • Y.C. Ling

    Y.C. Ling January 3rd, 2011 @ 08:32 AM

    Encountered the same issue.

    I still think it's good to apply David's patch.
    I'm working on a project depend on ActiveSupport (not other parts in rails),
    and using meta-programming methods such as alias_method_chain, set_callback.
    It's strange that I need to setting i18n gem manually in the Gemfile,
    even if I didn't use any localization functionality of ActiveSupport.

    I think make an unnecessary' dependency to i18n and builder is good.<br/> It makes the annoying things behind the scene.

  • 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>

Pages