NameError: uninitialized constant Date::ABBR_MONTHS

Discussion in 'Ruby' started by Jigar Gosar, Apr 11, 2007.

  1. Jigar Gosar

    Jigar Gosar Guest

    DATE::ABBR_MONTHS exists in this doc here.
    http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html
    Still I get the error.

    >ruby -v

    ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]


    irb(main):001:0> require "date"
    => true
    irb(main):002:0> Date::MONTHNAMES
    => [nil, "January", "February", "March", "April", "May", "June", "July",
    "August", "September", "October", "November", "December"]
    irb(main):003:0> DATE::ABBR_MONTHS
    NameError: uninitialized constant DATE
    from (irb):3
    irb(main):004:0>



    DATE::ABBR_MONTHS exists in this doc here.
    http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html

    And I was using this functionality till ruby 1.8.2 it suddenly stoped
    with the upgrade. can these guys just remove stuff without warning!!! or
    am I looking at wrong place?

    Please help

    --
    Posted via http://www.ruby-forum.com/.
    Jigar Gosar, Apr 11, 2007
    #1
    1. Advertising

  2. On 11 Apr 2007, at 13:26, Jigar Gosar wrote:

    > DATE::ABBR_MONTHS exists in this doc here.
    > http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html
    > Still I get the error.
    >
    >> ruby -v

    > ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
    >
    >
    > irb(main):001:0> require "date"
    > => true
    > irb(main):002:0> Date::MONTHNAMES
    > => [nil, "January", "February", "March", "April", "May", "June",
    > "July",
    > "August", "September", "October", "November", "December"]
    > irb(main):003:0> DATE::ABBR_MONTHS
    > NameError: uninitialized constant DATE
    > from (irb):3
    > irb(main):004:0>
    >
    >
    >
    > DATE::ABBR_MONTHS exists in this doc here.
    > http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html
    >
    > And I was using this functionality till ruby 1.8.2 it suddenly stoped
    > with the upgrade. can these guys just remove stuff without
    > warning!!! or
    > am I looking at wrong place?
    >
    > Please help
    >


    The hint is here:

    > NameError: uninitialized constant DATE
    > from (irb):3


    Try 'Date::ABBR_MONTHS'

    Alex Gutteridge

    Bioinformatics Center
    Kyoto University
    Alex Gutteridge, Apr 11, 2007
    #2
    1. Advertising

  3. Jigar Gosar wrote:

    > DATE::ABBR_MONTHS exists in this doc here.


    No, it doesn't.
    But Date::ABBR_MONTHS does.

    > http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html
    >
    > And I was using this functionality till ruby 1.8.2 it suddenly stoped
    > with the upgrade. can these guys just remove stuff without warning!!! or
    > am I looking at wrong place?


    Yes, this is a case of EBKAC, not a bug in stdlib.


    --
    Phillip "CynicalRyan" Gawlowski
    http://cynicalryan.110mb.com/

    Rule of Open-Source Programming #4:

    If you don't work on your project, chances are that no one will.
    Phillip Gawlowski, Apr 11, 2007
    #3
  4. On Wed, Apr 11, 2007 at 01:26:00PM +0900, Jigar Gosar wrote:
    > DATE::ABBR_MONTHS exists in this doc here.
    > http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html


    I don't see DATE::ABBR_MONTHS anywhere there. Can you point out *exactly*
    what you clicked to see this? It's probably a typo, it obviously should be
    Date::ABBR_MONTHS

    > And I was using this functionality till ruby 1.8.2 it suddenly stoped
    > with the upgrade. can these guys just remove stuff without warning!!! or
    > am I looking at wrong place?


    irb(main):001:0> require 'date'
    => true
    irb(main):002:0> Date::ABBR_MONTHS
    => {"oct"=>10, "jul"=>7, "jan"=>1, "dec"=>12, "jun"=>6, "apr"=>4, "feb"=>2,
    "may"=>5, "sep"=>9, "aug"=>8, "mar"=>3, "nov"=>11}
    irb(main):003:0> RUBY_VERSION
    => "1.8.4"
    Brian Candler, Apr 11, 2007
    #4
  5. Jigar Gosar

    Jigar Gosar Guest

    Well I get same error with Date::ABBR_MONTHS, installed latest ruby
    version 1.8.6 and typed in irb. guys is it working for you with 1.8.6
    please let me know


    irb(main):001:0> require "date"
    => true
    irb(main):002:0> Date::ABBR_MONTHS
    NameError: uninitialized constant Date::ABBR_MONTHS
    from (irb):2
    irb(main):003:0> RUBY_VERSION
    => "1.8.6"
    irb(main):004:0>


    thanks.


    Brian Candler wrote:
    > On Wed, Apr 11, 2007 at 01:26:00PM +0900, Jigar Gosar wrote:
    >> DATE::ABBR_MONTHS exists in this doc here.
    >> http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html

    >
    > I don't see DATE::ABBR_MONTHS anywhere there. Can you point out
    > *exactly*
    > what you clicked to see this? It's probably a typo, it obviously should
    > be
    > Date::ABBR_MONTHS
    >
    >> And I was using this functionality till ruby 1.8.2 it suddenly stoped
    >> with the upgrade. can these guys just remove stuff without warning!!! or
    >> am I looking at wrong place?

    >
    > irb(main):001:0> require 'date'
    > => true
    > irb(main):002:0> Date::ABBR_MONTHS
    > => {"oct"=>10, "jul"=>7, "jan"=>1, "dec"=>12, "jun"=>6, "apr"=>4,
    > "feb"=>2,
    > "may"=>5, "sep"=>9, "aug"=>8, "mar"=>3, "nov"=>11}
    > irb(main):003:0> RUBY_VERSION
    > => "1.8.4"



    --
    Posted via http://www.ruby-forum.com/.
    Jigar Gosar, Apr 15, 2007
    #5
  6. Jigar Gosar

    Jigar Gosar Guest

    Hey matz,

    Still no luck,

    irb(main):007:0> RUBY_VERSION
    => "1.8.6"
    irb(main):008:0> require 'date/format'
    => false
    irb(main):009:0> Date::ABBR_MONTHS
    NameError: uninitialized constant Date::ABBR_MONTHS
    from (irb):9
    irb(main):010:0>


    Can someone really try it in IRB and then help me out, please.

    Thanks.

    Yukihiro Matsumoto wrote:
    > Hi,
    >
    > In message "Re: NameError: uninitialized constant Date::ABBR_MONTHS"
    > on Mon, 16 Apr 2007 07:03:34 +0900, Yukihiro Matsumoto
    > <> writes:
    >
    > ||irb(main):001:0> require "date"
    > ||=> true
    > ||irb(main):002:0> Date::ABBR_MONTHS
    > ||NameError: uninitialized constant Date::ABBR_MONTHS
    > || from (irb):2
    > ||irb(main):003:0> RUBY_VERSION
    > ||=> "1.8.6"
    > ||irb(main):004:0>
    > |
    > |Try Date::ABBR_MONTHNAMES.
    >
    > My bad. You have to require 'date/format' to get ABBR_MONTHS.
    >
    > matz.



    --
    Posted via http://www.ruby-forum.com/.
    Jigar Gosar, Apr 16, 2007
    #6
  7. Jigar Gosar

    Jigar Gosar Guest

    Thanks, It worked.

    But the docs don't reflect this.
    http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html

    This change brought my site (http://www.simplegtd.com) down, for quite
    some time :)

    Thanks for the reply.

    --
    Jigar Gosar
    http://www.simplegtd.com

    Yukihiro Matsumoto wrote:
    > Hi,
    >
    > In message "Re: NameError: uninitialized constant Date::ABBR_MONTHS"
    > on Mon, 16 Apr 2007 14:55:17 +0900, Jigar Gosar
    > <> writes:
    >
    > |Hey matz,
    > |
    > |Still no luck,
    >
    > Hmm, I just found out 'Date::Format::ABBR_MONTHS' was the right name.
    > Sorry.
    >
    > matz.



    --
    Posted via http://www.ruby-forum.com/.
    Jigar Gosar, Apr 16, 2007
    #7
  8. Jigar Gosar

    bbiker Guest

    On Apr 16, 3:15 am, Yukihiro Matsumoto <> wrote:
    > Hi,
    >
    > In message "Re: NameError: uninitialized constant Date::ABBR_MONTHS"
    > on Mon, 16 Apr 2007 15:48:41 +0900, Jigar Gosar <> writes:
    >
    > |But the docs don't reflect this.
    > |http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/index.html
    >
    > RDoc in the source does not mention ABBR_MONTHS. So it might be a bug
    > in RDoc processor. Could you check, anyone? Ryan?
    >
    > matz.


    in irb

    Date::ABBR_MONTHNAMES ->
    [nil, "Jan", "Feb", "Mar", ... "Nov", "Dec"]

    Date::Format::ABBR_MONTHS ->
    {"oct"=>10, "jul"=>7, "jan"=>1, ... "mar"=>3, "nov"=>11}
    bbiker, Apr 16, 2007
    #8
  9. Phillip Gawlowski wrote:

    > No, it doesn't.
    > But Date::ABBR_MONTHS does.



    There is actually a discrepancy between the ruby docs and the ruby
    framework.

    Furthermore, a rails plugin actually tries to use this constant and it
    bombs out on my machine. I'm sure it worked for the plugin developer
    (perhaps b/c he had a diff version of ruby) but it doesn't for me.

    See the following post for details and work around:
    http://www.khurramvirani.com/2008/3/27/date-abbr_months-issue-in-aws-s3-ruby-library-2
    --
    Posted via http://www.ruby-forum.com/.
    Khurram Virani, Apr 3, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel
    Replies:
    2
    Views:
    460
    Daniel
    Jun 22, 2006
  2. Jose Pepe
    Replies:
    1
    Views:
    147
    Jose Pepe
    Jul 16, 2006
  3. Reid Thompson
    Replies:
    0
    Views:
    108
    Reid Thompson
    Oct 21, 2006
  4. Vikash Kumar
    Replies:
    2
    Views:
    114
    Vikash Kumar
    Nov 6, 2006
  5. Chris Duncan
    Replies:
    0
    Views:
    111
    Chris Duncan
    Apr 11, 2007
Loading...

Share This Page