Forum: Ruby on Rails Bizzare Date, DateTime, date_select issues

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Db64511212f54f955d7a7115dd3b834f?d=identicon&s=25 Scott Holmes (nor)
on 2006-04-10 19:09
I've been banging my head against this wall for several hours, and it
hurts now so I'll stop and ask someone.

In one of my forms I had been using a statement to extract the current
year for use with some form field calculations.

  <% currentyear = %>

And then further down several date_selects like the following,

    <%= date_select "member", "last_medical_date", :id =>
"member_last_medical_date", :order => [:year, :month, :day], :start_year
=> (currentyear - 5), :end_year => currentyear %>
    <label for="member_last_medical_date">Date of Last Medical Exam

The first statement subsequently stopped working!  Now with that
statement I get a "ArgumentError" where the has raised
an "invalid date" error.

If I use,

  <% currentyear = %>

instead, then I can get past THAT error, but then the date_select
statement raises the "invalid date" error message.

Out of desperation I've even uninstalled Ruby and Rails, and reinstalled
it all again.  This is all latest version stuff...   Ruby v1.8.4, Rails
v1.1.2, RadRails v0.6.1, MySQL v5.0.11 all running on Win2kSP4.

Any ideas?
Db64511212f54f955d7a7115dd3b834f?d=identicon&s=25 Scott Holmes (nor)
on 2006-04-10 20:49
Ok update;

  Ruby isn't the problem, as I can run an independant script with a
number of different Date/Time operations in order to extract the current
year (including the ones that don't work in rails).

  I've set up a whole new Rails environment on one of my Gentoo Linux
servers, moved my project over to that, and pointed it at the existing
MySQL server.  That worked fine!  So something in the setup of my
environment under Win2k has got buggered (like I said, things were
working, then they stopped!).  Uninstalling and re-installing didn't
help, but having to use two machines for development is just not right.

Any thoughts on how to correct this?

This topic is locked and can not be replied to.