zven
2006-May-18 19:42 UTC
[Rails] WebServices and DateTime - 3 elements of civil date are necessary
I simply trying to receive an array of objects, retrieved by ActiveRecord from table with datetime column and I have: test_list(SoapControllerApiTest): ArgumentError: 3 elements of civil date are necessary /usr/lib/ruby/1.8/date.rb:1214:in `new_with_hash'' /usr/lib/ruby/1.8/date.rb:1258:in `parse'' .... It''s a bug or I am wrong somewhere?
Chris Goodwin
2006-May-18 20:24 UTC
[Rails] Re: WebServices and DateTime - 3 elements of civil date are
Are you using Windows? I ran into the same problem. There is a problem with Ruby and the Windows DateTime format. I still haven''t found a solution to this. Supposedly ruby 1.9 fixes this, but after replacing the 1.8 date files with the 1.9 ones it still doesn''t work for me. zven wrote:> I simply trying to receive an array of objects, retrieved by > ActiveRecord from table with datetime column and I have: > > test_list(SoapControllerApiTest): > ArgumentError: 3 elements of civil date are necessary > /usr/lib/ruby/1.8/date.rb:1214:in `new_with_hash'' > /usr/lib/ruby/1.8/date.rb:1258:in `parse'' > .... > > It''s a bug or I am wrong somewhere?-- Posted via http://www.ruby-forum.com/.
zven
2006-May-18 20:36 UTC
[Rails] Re: WebServices and DateTime - 3 elements of civil date are
On Thu, 2006-05-18 at 22:24 +0200, Chris Goodwin wrote:> Are you using Windows? I ran into the same problem. There is a problem > with Ruby and the Windows DateTime format. I still haven''t found a > solution to this. Supposedly ruby 1.9 fixes this, but after replacing > the 1.8 date files with the 1.9 ones it still doesn''t work for me. >Nope, I am using Debian.
Conrad Taylor
2006-May-18 23:57 UTC
[Rails] WebServices and DateTime - 3 elements of civil date are necessary
Hi, what''s the relevant code that generates the below error? If you can post the relevant method, it would help the group better help you. Thanks, -Conrad On 5/19/06, zven <zven@nm.ru> wrote:> I simply trying to receive an array of objects, retrieved by > ActiveRecord from table with datetime column and I have: > > test_list(SoapControllerApiTest): > ArgumentError: 3 elements of civil date are necessary > /usr/lib/ruby/1.8/date.rb:1214:in `new_with_hash'' > /usr/lib/ruby/1.8/date.rb:1258:in `parse'' > .... > > It''s a bug or I am wrong somewhere? > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060518/a970e5c8/attachment.html
Using Ruby 1.8.4, Windows, and MySQL I ran into the same problem using the example in "Agile Web Development with Rails". (The same code worked fine on my coworker''s Mac.) If you want a really, really lame workaround so that you can continue in your development, you can add this to the self.parse(str=''-4712-01-01T00:00:00Z'', comp=false, sg=ITALY) function in date.rb: str.gsub!(" Eastern", "E") str.gsub!(" Standard", "S") str.gsub!(" Daylight", "D") str.gsub!(" Time", "T") ... before the "elem = _parse(str, comp)". (Make sure you add your time zone in there, too.) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---