I’m having trouble with Ruby’s Date class. I’m trying to do something
as simple as “Date.today” but I keep getting errors.
I’ve included “require ‘date’” to environment.rb but still no luck.
Am I doing something wrong?
Thanks,
-Andrew
I’m having trouble with Ruby’s Date class. I’m trying to do something
as simple as “Date.today” but I keep getting errors.
I’ve included “require ‘date’” to environment.rb but still no luck.
Am I doing something wrong?
Thanks,
-Andrew
What’s your Ruby version ?
C:\ruby\dev\buildview>ruby -v
ruby 1.8.2 (2004-12-25) [i386-mswin32]
What’s the error ?
C:\ruby\dev\buildview>irb
irb(main):001:0> Date.today
NameError: uninitialized constant Date
from (irb):1
irb(main):002:0> require ‘date’
=> true
irb(main):003:0> Date.today
=> #<Date: 4907419/2,0,2299161>
On 12/4/05, Andrew G. [email protected] wrote:
Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails
–
Ruby version: ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0]
I was able to duplicate what you showed in irb:
irb(main):001:0> Date.today
NameError: uninitialized constant Date
from (irb):1
irb(main):002:0> require ‘date’
=> true
irb(main):003:0> Date.today
=> #<Date: 4907419/2,0,2299161>
irb(main):004:0>
But when I try running my rails app I get the error: “undefined method
`today’ for #<Date: -1/2,0,2299161>”
-Andrew
On 12/5/05, Andrew G. [email protected] wrote:
=> #<Date: 4907419/2,0,2299161>
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs