invalid date error in many cases

87 views
Skip to first unread message

Guo Yangguang

unread,
Nov 13, 2010, 12:11:45 PM11/13/10
to rubyonra...@googlegroups.com
hi

i use rails 3.0.1,mysql2 and ruby 1.9.2 on windows 7,but i met invalid
date error in many places,for example,when add index,the error happens,i
cancel index,but when activate user account using restful_authentication
plugin,the error happens again.
so how to fix it? or can you recommend the stable rails version to
use.it seems to be a problem for a few people.

--
Posted via http://www.ruby-forum.com/.

Guo Yangguang

unread,
Nov 13, 2010, 11:36:49 PM11/13/10
to rubyonra...@googlegroups.com
can you give some suggestions?

David Kahn

unread,
Nov 13, 2010, 11:57:26 PM11/13/10
to rubyonra...@googlegroups.com
On Sat, Nov 13, 2010 at 10:36 PM, Guo Yangguang <li...@ruby-forum.com> wrote:
can you give some suggestions?

Can you provide specific code examples and resulting errors.... that would allow someone here to attempt to help you.
 
--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Guo Yangguang

unread,
Nov 14, 2010, 12:19:58 AM11/14/10
to rubyonra...@googlegroups.com
David Kahn wrote in post #961291:

> On Sat, Nov 13, 2010 at 10:36 PM, Guo Yangguang
> <li...@ruby-forum.com>wrote:
>
>> can you give some suggestions?
>>
>
> Can you provide specific code examples and resulting errors.... that
> would
> allow someone here to attempt to help you.


I have copied the code examples in the attached file,thank you for your
help.

Attachments:
http://www.ruby-forum.com/attachment/5365/invalid_date.txt

David Kahn

unread,
Nov 14, 2010, 12:35:27 AM11/14/10
to rubyonra...@googlegroups.com

The error seems to be in users_controller.rb line 32.... can you show the code of this line and the surrounding method:
ArgumentError (invalid date):
app/controllers/users_controller.rb:32:in `activate'


 


--

Guo Yangguang

unread,
Nov 14, 2010, 1:02:43 AM11/14/10
to rubyonra...@googlegroups.com
> The error seems to be in users_controller.rb line 32.... can you show
> the
> code of this line and the surrounding method:
>
> ArgumentError (invalid date):
> app/controllers/users_controller.rb:32:in `activate'

line 32 is following:
user = User.find_by_activation_code(params[:activation_code]) unless
params[:activation_code].blank?

the surrounding methods are in attached file.

the activate is method invoked by a link in email template which is sent
successfully by an observer.

the route for activate method:
match '/activate/:activation_code' => 'users#activate', :as =>
:activate, :activation_code => nil

Guo Yangguang

unread,
Nov 14, 2010, 1:09:09 AM11/14/10
to rubyonra...@googlegroups.com
> The error seems to be in users_controller.rb line 32.... can you show
> the
> code of this line and the surrounding method:
>
> ArgumentError (invalid date):
> app/controllers/users_controller.rb:32:in `activate'

line 32 is following:


user = User.find_by_activation_code(params[:activation_code]) unless
params[:activation_code].blank?

the surrounding methods are in attached file.

the activate is method invoked by a link in email template which is sent
successfully by an observer.

the route for activate method:
match '/activate/:activation_code' => 'users#activate', :as =>
:activate, :activation_code => nil

Attachments:
http://www.ruby-forum.com/attachment/5366/surrounding_and_method_itself.txt

Guo Yangguang

unread,
Nov 14, 2010, 2:55:36 AM11/14/10
to rubyonra...@googlegroups.com
I created an user and read it in my rails console,the same error
happened,it seems mysql2 has bug,but i don't know how to manage it?
please see the attachment.

Attachments:
http://www.ruby-forum.com/attachment/5367/invalid_date.PNG

Guo Yangguang

unread,
Nov 14, 2010, 3:48:41 AM11/14/10
to rubyonra...@googlegroups.com
hi

I have resolved the problem by uninstalling mysql2 and using the old
mysql gem.Thank you David.

Reply all
Reply to author
Forward
0 new messages