Sounds like you're using rails 1.x. n.months (or n.days etc...) used
to be dumb: it just converted an integer into a corresponding number
of seconds, an approach with obvious limitations.
In rails 2, it's smarter and leverages Date to di it's computations,
so when I run your code I get
Sat Mar 01 00:00:00 UTC 2008
Fri Feb 01 00:00:00 UTC 2008
Tue Jan 01 00:00:00 UTC 2008
Sat Dec 01 00:00:00 UTC 2007
Thu Nov 01 00:00:00 UTC 2007
Mon Oct 01 00:00:00 UTC 2007
Sat Sep 01 00:00:00 UTC 2007
Wed Aug 01 00:00:00 UTC 2007
Sun Jul 01 00:00:00 UTC 2007
Fri Jun 01 00:00:00 UTC 2007
Tue May 01 00:00:00 UTC 2007
Sun Apr 01 00:00:00 UTC 2007
(Note also how your code drifts, because it's effectively just
subtracting a fixed number of days and not all months have the same
length).
If you're stuck with 1.x this probably does the trick too
0.upto(11) do |n|
puts Time.now.months_ago(n).beginning_of_month
end