FS#9809 - ruby undefined method Time.parse
Attached to Project:
Arch Linux
Opened by kkl2401 (kkl2401) - Tuesday, 11 March 2008, 00:00 GMT
Last edited by Aaron Griffin (phrakture) - Monday, 31 March 2008, 16:43 GMT
Opened by kkl2401 (kkl2401) - Tuesday, 11 March 2008, 00:00 GMT
Last edited by Aaron Griffin (phrakture) - Monday, 31 March 2008, 16:43 GMT
|
Details
Description: Ruby from extra doesn't seem to know
Time.parse() method.
Running the following: echo "p Time.parse('2008-03-11')" | ruby outputs: -:1: undefined method `parse' for Time:Class (NoMethodError) If I try it on a non-Arch machine, I get the correct answer: echo "p Time.parse('2008-03-11')" | ruby Tue Mar 11 00:00:00 +0100 2008 I have the latest ruby from extra: ruby -v ruby 1.8.6 (2008-03-03 patchlevel 114) [x86_64-linux] but the previous one (patchlevel 111) was also affected. |
This task depends upon
Closed by Aaron Griffin (phrakture)
Monday, 31 March 2008, 16:43 GMT
Reason for closing: Not a bug
Additional comments about closing: See last comment
Monday, 31 March 2008, 16:43 GMT
Reason for closing: Not a bug
Additional comments about closing: See last comment
require 'time'
Don't know while not available without including time.rb.
But maybe they are extensions which need explicit including. From ruby.doc:
"Implements the extensions to the Time class that are described in the documentation for the time.rb library."
Also many other methods defined after Time.parse are not available without including (rfc2822,...)
this is how we build it. i see nothing wrong there. if you tell me how to fix it, i might include it.
I think this is not a bug. The core ruby documentation http://www.ruby-doc.org/core/ is not the documentation of core ruby classes, but the output of rdoc program, running on ruby sources. Really core classes are the classes defined in files you can see in this topic http://www.ruby-forum.com/topic/146178#new. So I think, that ruby on other machines of kkl2401 was builded with different build options.
kkl2401, can you provide output of "ruby -rrbconfig -e 'p Config::CONFIG'" from non-arch machine?
I tried playing with it in a few environments (different Linux distributions, cygwin's ruby on Windows, jruby, ...) and I came to a conclusion that the difference was not ruby itself but a presence/absence of rubygems. It seems that rubygems somehow (perhaps also with the assistence of $RUBYOPTS) load the 'time' library and that was probably what confused me in the first place because I probably didn't have it installed on Arch but had it everywhere else and it didn't occur to me that this actually might be behind it.
So I'm sorry I brought it up, my bad (still, ruby could be better documented in some places... *sigh*).