I have some controller code that uses the ‘httpdate’ method of a
‘created_on’ field from my database. I’m running Rails on the Edge. My
development environment is Windows XP, my ‘production’ environment is
Debian Linux.
When I upgraded my ‘production’ machine for the first time in a month, I
start getting an error that ‘httpdate’ is not a method of ‘created_on’.
This part of the code is unchanged. This method is defined in ‘time.rb’
as part of the Ruby distribution.
If I add “require ‘time’” to my controller, all is well again. I can
find no “require ‘time’” line in my vendor Rails code.
Some questions:
- Why did my original code work with earlier versions of Edge
Rails? - Why did my original code work on Windows but not Linux?
- Is this a production vs development issue?
- What else is different that I may not find until I’m in
production? - Is it my responsibility to do the “require” here, or is it
reasonable to expect Rails to do this for me?