It’s a simple bug in the utc implementation. Time.utc
(http://www.ruby-doc.org/core/classes/Time.html#M000252) gets passed in
a number of arguments which are all ints except for the second one. The
Time.utc implementation tries to convert all to an int, and fails when
it gets a string for the second argument. The simple snippet below works
with MRI but fails with IronRuby.
Time.utc(2000,“jan”,1,20,15,1)
Are you able to build from source as described at
http://wiki.github.com/ironruby/ironruby? If so, we can fix this and
push the patch to github for you to pick up?
If not, you can workaround it by monkey-patching Time.utc with something
like this:
class Time
class << self
@@months = [“jan”, “feb”, “mar”, “apr”, “may”,
“jun”, “jul”, “aug”, “sep”, “oct”, “nov”, “dec”]
alias :old_utc :utc
def utc(*args)
if args.size >= 2
if args[1].kind_of? String
args[1] = @@months.index(args[1]) + 1
end
end
old_utc(*args)
end
end
end
From: [email protected]
[mailto:[email protected]] On Behalf Of James Thompson
Sent: Tuesday, October 27, 2009 10:03 AM
To: [email protected]
Subject: [Ironruby-core] Issue with ActionMailer that appears to run
deep
I just posted an issue:
http://ironruby.codeplex.com/WorkItem/View.aspx?WorkItemId=2946
It looks like something is going odd between the UTC method defined in
TimeOps.cs and the RACC parser. Anyone who understands the internals
better than I want to take a look at the stack trace I attached and tell
me if I may be missing something?
This is blocking my deployment of a Rails app because using ActionMailer
is giving me this.
Thanks!
James Thompson
Plain Programs
New Orleans, LA
P: (502) 619.0353
E: [email protected]mailto:[email protected]
W: www.plainprograms.comhttp://www.plainprograms.com