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.

warnings on ActiveSupport with ruby 1.9.2

#4618

Got the folowing warnings with ruby 1.9.2 on ActiveSupport

1 time:

...gems/tzinfo-0.3.20/lib/tzinfo/timezone.rb:81: warning: character class has duplicated range: /^[A-z0-9+-]+(\/[A-z0-9+-]+)*$/

2 times:

...activesupport/lib/active_support/dependencies.rb:209: warning: loading in progress, circular require considered harmful - /Users/hussein/.rvm/gems/ruby-1.9.2-head@bugmash/gems/tzinfo-0.3.20/lib/tzinfo/timezone.rb

1 time:

...gems/ruby-1.9.2-head@bugmash/gems/i18n-0.4.0.beta1/lib/i18n/backend/base.rb:130: warning: shadowing outer local variable - key

1 time:

...rails/activesupport/lib/active_support/ordered_hash.rb:15:in to_yaml': YAML.quick_emit is deprecated
...rails/activesupport/lib/active_support/ordered_hash.rb:15:into_yaml': YAML.quick_emit is deprecated

I removed absolute paths

Reported by Hussein Morsy · May 16th, 2010 @ 04:35 PM

State: committed
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • Assigned user set to José Valim

    Confirmed.

    The first two I suspect are issues with tzinfo. Regarding the last one, I found this bug report that says quick_emit is deprecated, http://redmine.ruby-lang.org/issues/show/3112

    May 23rd, 2010 @ 11:30 AM

  2. Rohit Arondekar
    Rohit Arondekar

    Addendum to my previous comment:

    This is the feature => http://redmine.ruby-lang.org/issues/show/2340 that explains why YAML/Syck was considered harmful and a discussion as to choose an alternative, and by the looks of it YAML/Psych( http://github.com/tenderlove/psych ) was chosen. But not officially.

    In the bug report linked above the various methods deprecated and giving problems have been mentioned along with a few answers in a FAQ style. However it assumes that Psych was chosen. In the discussions that follow it shows that a final decision has not been taken yet. So I think we should wait for this issue to resolve there? Psych may be modified to be fully compatible API wise to Syck.

    May 23rd, 2010 @ 11:48 AM

  3. Phil Ross
    Phil Ross

    I've just released version 0.3.21 of TZInfo. This contains fixes for the first two warnings.

    May 28th, 2010 @ 10:51 PM

  4. Rohit Arondekar
    Rohit Arondekar
    • Tag changed from bugmash to rails 3, activesupport, ruby1.9.2, warnings
    • State changed from new to open

    The warnings are now of the following types:

    /home/rohit/.rvm/gems/ruby-1.9.2-head@bugmash/gems/nokogiri-1.4.2/lib/nokogiri/css/generated_parser.rb:668: warning: mismatched indentations at 'end' with 'module' at 11
    
    /home/rohit/.rvm/gems/ruby-1.9.2-head@bugmash/gems/i18n-0.4.1/lib/i18n/backend/simple.rb:74: warning: shadowing outer local variable - key
    
    /home/rohit/remote-repos/rails_patches/working4/activesupport/lib/active_support/file_update_checker.rb:31: warning: instance variable @last_update_at not initialized
    
    /home/rohit/remote-repos/rails_patches/working4/activesupport/lib/active_support/ordered_hash.rb:15:in `to_yaml': YAML.quick_emit is deprecated
    

    I've already fixed the 3rd type of warnings. Attached is the patch that fixes it. Tests pass on 1.9.2-head and 1.8.7.

    June 21st, 2010 @ 09:32 AM

  5. José Valim
    José Valim

    Note: the patch above was applied. I'm waiting for more patches to get the other warnings handled as well. :)

    June 22nd, 2010 @ 04:46 PM

  6. Rohit Arondekar
    Rohit Arondekar

    A new warning has emerged.

    activesupport/lib/active_support/log_subscriber.rb:39: warning: method redefined; discarding old logger
    

    Discussed with Jose and made a patch. I couldn't attach it because Lighthouse seems to be going through some problems. Keep getting an error if I try to attach a patch. I've put the patch in a gist. To view the patch: http://gist.github.com/452761 To download the patch: http://gist.github.com/gists/452761/download

    Now onto the other warnings.

    gems/nokogiri-1.4.2/lib/nokogiri/css/generated_parser.rb:668: warning: mismatched indentations at 'end' with 'module' at 11
    

    This warning, according to this thread is because of older version of libxml2 or libiconv. The discussion is old and I don't know if this still holds. On a debian based system, there is no package libiconv — so I don't know if I'm using the latest version or not. If I get hold of Aaron I'll ask him about this or make an issue for nokogiri.

    gems/i18n-0.4.1/lib/i18n/backend/simple.rb:74: warning: shadowing outer local variable - key
    

    This warning is from i18n gem itself. The fix is simple, but Sven (an author of the gem) says that these warnings will most likely be suppressed in 1.9.2 (final). So this should go away on it's own.

    activesupport/lib/active_support/ordered_hash.rb:15:in `to_yaml': YAML.quick_emit is deprecated
    

    Refer to my 1st and 2nd comment in this ticket. I don't know what has to be used instead of quick_emit, but if it's deprecated, that means there must be another way to do a .quick_emit. I'll dig into this soon.

    June 25th, 2010 @ 01:10 PM

  7. Repository
    Repository

    (from [cae33c41589373d62c76e2bb3cdb3fa023ec8521]) Remove previously defined class method logger to supress warnings in Active Support test suites. [#4618 warnings on ActiveSupport with ruby 1.9.2 state:open]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/cae33c41589373d62c76e2bb3cdb3f...

    June 25th, 2010 @ 11:59 PM

  8. José Valim
    José Valim
    • State changed from open to committed
    • Importance changed from to Low

    We cannot possible fix all warnings, so I'm closing this one. However, if you spot new warnings, patches are welcome.

    July 8th, 2010 @ 10:14 PM

  9. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:45 PM

  10. Jeff Kreeftmeijer
  11. bingbing