This project is archived and is in readonly mode.

#4618 ✓committed
Hussein Morsy

warnings on ActiveSupport with ruby 1.9.2

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

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

Comments and changes to this ticket

  • Rohit Arondekar

    Rohit Arondekar May 23rd, 2010 @ 11:30 AM

    • 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

  • Rohit Arondekar

    Rohit Arondekar May 23rd, 2010 @ 11:48 AM

    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.

  • Phil Ross

    Phil Ross May 28th, 2010 @ 10:51 PM

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

  • Rohit Arondekar

    Rohit Arondekar June 21st, 2010 @ 09:32 AM

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

  • José Valim

    José Valim June 22nd, 2010 @ 04:46 PM

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

  • Rohit Arondekar

    Rohit Arondekar June 25th, 2010 @ 01:10 PM

    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.

  • Repository

    Repository June 25th, 2010 @ 11:59 PM

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

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

  • José Valim

    José Valim July 8th, 2010 @ 10:14 PM

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

  • Ryan Bigg

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

    • Tag cleared.

    Automatic cleanup of spam.

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

Referenced by

Pages