Date.new exception in controller

Hi all,

I’m fairly new to rails and probably doing something stupid here.
Unfortunately, I can’t come up with a good search term to help solve
the problem – I hope someone here can help :slight_smile:

I’m getting an “invalid date” exception when I call, say,

t1 = Date.new( 2007, 4, 27 )

in my controller class. I’m puzzled by this, because both in irb but
also in script/console (same project) this works fine. I’ve tried
Date.parse, Date.civil – they all lead to the same error (because
they ultimately call the same problematic method).

Does anyone know why this doesn’t work in the controller? I’m using
Locomotive 2.0.8 on OSX, which corresponds to ruby 1.8.6 and rails
1.2.3. The “invalid date” exception is raised in “new!” at

lib/ruby/1.8/date.rb:727:in new!' lib/ruby/1.8/date.rb:729:innew’

Looking at the code in date.rb doesn’t ring any bells, either. One
thing I noted was that during my attempts to solve this problem I also
got

lib/ruby/1.8/date.rb:727:in new!' lib/ruby/1.8/Date.rb:729:innew’

at some point. Note the capital ‘D’. Now, this might be significant,
because HFS+, the OSX file system, is case-insensitive (but case-
preserving). Could there be a problem with file name clashes or is
this merely cosmetic?

Any input greatly appreciated,
Sven