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 Gruner <gruner.rails-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- ------------------------------ Joyeux Noël ------------------------------ Peter Fitzgibbons _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org 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 Gruner <gruner.rails-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Show your code and error/trace for more help. -- ------------------------------ Joyeux Noël ------------------------------ Peter Fitzgibbons _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails