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.

ActiveSupport gem should depend on builder (and i18n?)

#2672

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

Reported by Elia Schito · May 18th, 2009 @ 04:44 PM

State: incomplete
Milestone: 2.x
Assigned to: Ryan Bigg Ryan Bigg
Importance: none

Activity

  1. Rishav Rastogi
    Rishav Rastogi
    • 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.

    April 11th, 2010 @ 11:32 PM

  2. Ryan Bigg
    Ryan Bigg

    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.

    April 12th, 2010 @ 12:06 AM

  3. Rishav Rastogi
    Rishav Rastogi

    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.

    April 13th, 2010 @ 11:51 PM

  4. Ryan Bigg
    Ryan Bigg
    • 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.

    April 14th, 2010 @ 12:10 AM

  5. ravinggenius
    ravinggenius
    • 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.

    October 8th, 2010 @ 12:20 AM

  6. Ryan Bigg
    Ryan Bigg
    • State changed from invalid to incomplete

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

    October 8th, 2010 @ 12:24 AM

  7. David Haslem
    David Haslem

    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.

    October 20th, 2010 @ 06:04 PM

  8. David Haslem
    David Haslem
    • Tag changed from activesupport to activesupport, patch

    Forgot to add patch tag.

    October 20th, 2010 @ 06:05 PM

  9. Gabe da Silveira
    Gabe da Silveira
    • 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.

    October 20th, 2010 @ 06:13 PM

  10. Gabe da Silveira
    Gabe da Silveira
    • 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)

    October 20th, 2010 @ 06:15 PM

  11. David Haslem
    David Haslem

    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.

    October 20th, 2010 @ 06:26 PM

  12. David Haslem
    David Haslem

    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.

    October 20th, 2010 @ 06:42 PM

  13. Y.C. Ling
    Y.C. Ling

    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.

    January 3rd, 2011 @ 08:32 AM

  14. bingbing