<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=Section1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>If you want an immediate fix go to RubyClass.cs and add </span><span style='font-size:10.0pt;font-family:"Courier New"'>&amp;&amp; initializer <span style='color:blue'>is</span> <span style='color:#2B91AF'>RubyLibraryMethodInfo </span></span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>to the condition on line 1213:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:blue'>bool</span><span style='font-size:10.0pt;font-family:"Courier New"'> hasLibraryInitializer = !hasRubyInitializer &amp;&amp; initializer.DeclaringModule != Context.ObjectClass <span style='background:yellow;mso-highlight:yellow'>&amp;&amp; initializer <span style='color:blue'>is</span> <span style='color:#2B91AF'>RubyLibraryMethodInfo</span></span>;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>That should do the trick.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Tomas<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> ironruby-core-bounces@rubyforge.org [mailto:ironruby-core-bounces@rubyforge.org] <b>On Behalf Of </b>Tomas Matousek<br><b>Sent:</b> Saturday, July 25, 2009 5:16 PM<br><b>To:</b> ironruby-core@rubyforge.org<br><b>Subject:</b> Re: [Ironruby-core] Can't create instances<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Does any of the C# subclasses have Initialize method? That might be the problem. I’ll fix it asap.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Tomas<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> ironruby-core-bounces@rubyforge.org [mailto:ironruby-core-bounces@rubyforge.org] <b>On Behalf Of </b>Ivan Porto Carrero<br><b>Sent:</b> Saturday, July 25, 2009 4:45 PM<br><b>To:</b> ironruby-core@rubyforge.org<br><b>Subject:</b> Re: [Ironruby-core] Can't create instances<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>It's a subclass of RubyController (<a href="http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvc/Controllers/RubyController.cs">http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvc/Controllers/RubyController.cs</a>)<o:p></o:p></p><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>There are no constructors defined in any of the class definitions.<o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>HomeController.rb:<o:p></o:p></p></div><div><p class=MsoNormal><a href="http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvcWeb/Controllers/HomeController.rb">http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvcWeb/Controllers/HomeController.rb</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>Ruby controller base class:<o:p></o:p></p></div><div><p class=MsoNormal><a href="http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvc/Controllers/controller.rb#L360">http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvc/Controllers/controller.rb#L360</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div><div><p class=MsoNormal>RubyController:<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><a href="http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvc/Controllers/RubyController.cs">http://github.com/casualjim/ironrubymvc/blob/f9b28881187865dcff3389231e627ee2c4f93d14/IronRubyMvc/Controllers/RubyController.cs</a><br clear=all>---<br>Met vriendelijke groeten - Best regards - Salutations<br>Ivan Porto Carrero<br>Blog: <a href="http://flanders.co.nz">http://flanders.co.nz</a><br>Twitter: <a href="http://twitter.com/casualjim">http://twitter.com/casualjim</a><br>Author of IronRuby in Action (<a href="http://manning.com/carrero">http://manning.com/carrero</a>)<br><br><o:p></o:p></p><div><p class=MsoNormal>On Sun, Jul 26, 2009 at 1:30 AM, Tomas Matousek &lt;<a href="mailto:Tomas.Matousek@microsoft.com">Tomas.Matousek@microsoft.com</a>&gt; wrote:<o:p></o:p></p><div><div><p><span style='font-size:11.0pt;color:#1F497D'>What is the class being created that fails?</span><o:p></o:p></p><p><span style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p><span style='font-size:11.0pt;color:#1F497D'>Tomas</span><o:p></o:p></p><p><span style='font-size:11.0pt;color:#1F497D'>&nbsp;</span><o:p></o:p></p><p><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:10.0pt'> <a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a> [mailto:<a href="mailto:ironruby-core-bounces@rubyforge.org" target="_blank">ironruby-core-bounces@rubyforge.org</a>] <b>On Behalf Of </b>Ivan Porto Carrero<br><b>Sent:</b> Saturday, July 25, 2009 4:01 PM<br><b>To:</b> ironruby-core<br><b>Subject:</b> [Ironruby-core] Can't create instances</span><o:p></o:p></p><div><div><p>&nbsp;<o:p></o:p></p><p>Hi<o:p></o:p></p><div><p>&nbsp;<o:p></o:p></p></div><div><p>I just updated from github and ironrubymvc broke.<o:p></o:p></p></div><div><p>&nbsp;<o:p></o:p></p></div><div><p>This method would happily execute before the update.<o:p></o:p></p></div><div><p>&nbsp;<o:p></o:p></p></div><div><div><p>public object CreateInstance(RubyClass rubyClass)<o:p></o:p></p></div><div><p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;{<o:p></o:p></p></div><div><p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return Operations.CreateInstance(rubyClass);<o:p></o:p></p></div><div><p>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}<o:p></o:p></p></div><div><p>&nbsp;<o:p></o:p></p></div><div><p>Now it throws an exception. Do I need to change something?<o:p></o:p></p></div><div><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>ArgumentException: wrong number of arguments (0 for 1)]</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame) +58</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; Microsoft.Scripting.Interpreter.Interpreter.RunInstructions(InterpretedFrame frame) +90</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame) +104</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; Microsoft.Scripting.Interpreter.LightLambda.Run2(T0 arg0, T1 arg1) +337</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; IronRuby.Runtime.Calls.InterpretedFuncDispatcher`2.Invoke(CallSite callSite, T0 arg0) +574</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +1217</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; CallSite.Target(Closure , CallSite , Object ) +414</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Dynamic.UpdateDelegates.UpdateAndExecute1(CallSite site, T0 arg0) +1217</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; Microsoft.Scripting.Runtime.DynamicOperations.CreateInstance(Object obj, Object[] parameters) +209</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; Microsoft.Scripting.Hosting.ObjectOperations.CreateInstance(Object obj, Object[] parameters) +51</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.IronRuby.Core.RubyEngine.CreateInstance(RubyClass rubyClass) in C:\dev\ironrubymvc\IronRubyMvc\Core\RubyEngine.cs:100</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.IronRuby.Controllers.RubyControllerFactory.ConfigureController(RubyClass rubyClass, RequestContext requestContext) in C:\dev\ironrubymvc\IronRubyMvc\Controllers\RubyControllerFactory.cs:87</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.IronRuby.Controllers.RubyControllerFactory.LoadController(RequestContext requestContext, String controllerName) in C:\dev\ironrubymvc\IronRubyMvc\Controllers\RubyControllerFactory.cs:73</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.IronRuby.Controllers.RubyControllerFactory.CreateController(RequestContext requestContext, String controllerName) in C:\dev\ironrubymvc\IronRubyMvc\Controllers\RubyControllerFactory.cs:40</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +128</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +57</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181</span><o:p></o:p></pre><pre><span style='font-size:11.0pt;font-family:"Lucida Console"'>&nbsp;&nbsp; System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75</span><o:p></o:p></pre></div><p style='margin-bottom:12.0pt'>---<br>Met vriendelijke groeten - Best regards - Salutations<br>Ivan Porto Carrero<br>Blog: <a href="http://flanders.co.nz" target="_blank">http://flanders.co.nz</a><br>Twitter: <a href="http://twitter.com/casualjim" target="_blank">http://twitter.com/casualjim</a><br>Author of IronRuby in Action (<a href="http://manning.com/carrero" target="_blank">http://manning.com/carrero</a>)<o:p></o:p></p></div></div></div></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Ironruby-core mailing list<br><a href="mailto:Ironruby-core@rubyforge.org">Ironruby-core@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/ironruby-core" target="_blank">http://rubyforge.org/mailman/listinfo/ironruby-core</a><o:p></o:p></p></div><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></body></html>