Forum: Ruby problem with date and date/format

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-10 19:26
(Received via mailing list)
i've a RubyCocoa app, working well on my computer, but this app crashed
on another one the error message being :

/Applications/BookmarksMerge.app/Contents/Resources/ThirdParty/date/
format.rb:6: Date is not a class (TypeError)
        from
/Applications/BookmarksMerge.app/Contents/Resources/ThirdParty/
date.rb:197
        from
/Applications/BookmarksMerge.app/Contents/Resources/rb_main.rb:43

the line 43 in my rb_main.rb being :

require 'date'

line 6 of format.rb being simply :

class Date


and line 197 of date.rb :

require 'date/format'


how this could work on one computer and not on another ???
D111305c32e46f7dd2794a956208d347?d=identicon&s=25 E. Saynatkari (Guest)
on 2006-03-10 19:43
unknown wrote:
> i've a RubyCocoa app, working well on my computer, but this app crashed
> on another one the error message being :
>
> /Applications/BookmarksMerge.app/Contents/Resources/ThirdParty/date/
> format.rb:6: Date is not a class (TypeError)
>         from
> /Applications/BookmarksMerge.app/Contents/Resources/ThirdParty/
> date.rb:197
>         from
> /Applications/BookmarksMerge.app/Contents/Resources/rb_main.rb:43
>
> the line 43 in my rb_main.rb being :
>
> require 'date'
>
> line 6 of format.rb being simply :
>
> class Date
>
>
> and line 197 of date.rb :
>
> require 'date/format'
>
>
> how this could work on one computer and not on another ???

That error message would be caused by something like this:

  module Date
  end

  class Date
  end

However, Date being a standard class and hence loaded at startup,
I am not quite sure how this would occur. Perhaps grep for another
definition?


E
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-10 19:54
(Received via mailing list)
E. Saynatkari <none@none.net> wrote:

>
> However, Date being a standard class and hence loaded at startup,
> I am not quite sure how this would occur. Perhaps grep for another
> definition?

may be that's the LOAD_PATH being too large, finding another class Date
?

or date being included elsewhere on my back ? ;-)

for sure i'll grep...
C8da03a9f69be8910fa9b16b4db969ed?d=identicon&s=25 unknown (Guest)
on 2006-03-12 07:05
(Received via mailing list)
E. Saynatkari <none@none.net> wrote:

>
> However, Date being a standard class and hence loaded at startup,
> I am not quite sure how this would occur. Perhaps grep for another
> definition?

yes they are two definitions of class Date one in date.rb at line 392
the other in date/format.rb at line 6.

what i don't understand is that this (prob) doesn't cause a crash on mu
machine only on a user machine ???

i'm not using directly date, it is called by yaml.
This topic is locked and can not be replied to.