Ruby on rails 3.1 从Rails 3.0.14升级到Rails 3.1.4后参数数量错误(3对2)
在Rails 3.0.14中,一切都运行得很好,但是在更改之后Ruby on rails 3.1 从Rails 3.0.14升级到Rails 3.1.4后参数数量错误(3对2),ruby-on-rails-3.1,Ruby On Rails 3.1,在Rails 3.0.14中,一切都运行得很好,但是在更改之后 gem'rails',3.0.14'到gem'rails',3.1.4'并运行bundle update rails我现在得到以下错误: Started GET "/" for 127.0.0.1 at 2012-03-16 11:11:44 -0400 Processing by PagesController#index as HTML Completed 500 Internal Server Error in 54m
gem'rails',3.0.14'
到gem'rails',3.1.4'
并运行bundle update rails
我现在得到以下错误:
Started GET "/" for 127.0.0.1 at 2012-03-16 11:11:44 -0400
Processing by PagesController#index as HTML
Completed 500 Internal Server Error in 54ms
ArgumentError (wrong number of arguments (3 for 2)):
app/controllers/application_controller.rb:37:in `customize_by_subdomain'```
最流行的答案似乎是sqlite3需要更新,但我确实捆绑更新了sqlite3
,我仍然有同样的问题
以下是完整的跟踪:
它抱怨的方法如下所示:
35 def customize_by_subdomain
36 subdomain = (request.subdomain.present? && request.subdomain != 'www' && request.subdomain) || 'launch'
37 @current_org = Organization.find_by_subdomain(subdomain) || Organization.find_by_subdomain('launch')
38 end
我研究了大量类似的问题,但没有发现任何能解决我问题的方法。最接近我的问题是:但我使用的是authlogic,我使用的版本在升级rails后没有改变
唯一有趣的是我的整个测试套件都通过了,除了一个请求/集成规范,它经历了创建新用户的过程。奇怪的是,当我甚至无法访问开发中的页面时,我的请求规范工作正常
关于我能做些什么来弄清这个问题,你有什么想法吗?看来你的New Relic插件可能需要更新到新版本。在stacktrace中,第一行来自plugins文件夹中的newrelic代码。在他们的网站上,看起来他们发布了新的Rails 3.1特定代码: 在博客文章中,他们讨论了ActiveRecord日志记录方式的变化,并且您的异常是在log_with_instrumentation方法上触发的 现在看来,您应该将其安装为gem而不是插件:
希望这有帮助。这方面做得不错。取出NewRelic插件可以修复所有问题