简体   繁体   English

Rails 2.3.11应用程序对Ruby 1.9.2抛出“不支持通过define_method()定义的方法传递super的隐式参数传递”错误

[英]Rails 2.3.11 app to Ruby 1.9.2 throwing “implicit argument passing of super from method defined by define_method() is not supported” errors

Just dropped Rails Installer on a new Windows 7 box. 刚刚将Rails Installer放到新的Windows 7盒子上。 Cloned my Rails 2.3.11 app and installed all gems with no issues, but as I started clicking around the app I'm running into this in several places: 克隆了我的Rails 2.3.11应用程序并安装了所有gem,没有任何问题,但是当我开始单击该应用程序时,我在几个地方遇到了这个问题:

"implicit argument passing of super from method defined by define_method() is not supported. Specify all arguments explicitly." “不支持从define_method()定义的方法隐式传递super的参数。显式指定所有参数。”

Read a few threads relating to the same message, but I'm not grasping what's going on in my case. 阅读与同一条消息相关的一些主题,但是我不了解我的情况。

I did notice the error popping up on a search form using SearchLogic and on my login form which is using AuthLogic. 我确实注意到使用SearchLogic在搜索表单上以及使用AuthLogic的登录表单上弹出该错误。 Wondering if there's a correlation between this issue on 1.9.x and these two *Logic plugins? 想知道1.9.x上的此问题与这两个* Logic插件之间是否存在关联?

For example one of the errors is reference this line in my login form? 例如,错误之一是在我的登录表单中引用此行?

<%= f.text_field :login %>

Any guidance is appreciated. 任何指导表示赞赏。

Are you using a FormBuilder, perhaps ErrorHandlingFormBuilder from the old Advanced Rails Recipes book? 您是否正在使用FormBuilder,也许是旧《高级Rails食谱》书中的ErrorHandlingFormBuilder? If so, you need to look at the form builder code. 如果是这样,则需要查看表单构建器代码。

You will see this code: 您将看到以下代码:

  build_shell(field, options) do
    super
  end

It's that "super" line that is causing your problem. 这是导致您出现问题的“超级”行。 Change it to: 更改为:

  build_shell(field, options) do
    super(name, *args)
  end

原来我是个白痴,我试图在Ruby 1.9.2上运行Rails 2.3.8应用程序:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM