2012-03-16 84 views
0

一切工作正常Rails中3.0.14,但改变 gem 'rails', '3.0.14'gem 'rails', '3.1.4'和运行bundle update rails后,我现在得到以下错误:错误的参数数目(3 2)3.1.4

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的需要更新,但我没有bundle update sqlite3,我仍然有同样的问题。

以下是完整的跟踪:https://gist.github.com/2050530

它抱怨看起来像这样的方法:

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 

我已经看过类似的问题众多,我没有发现任何解决我的问题。最接近的是我的问题是:wrong number of arguments (3 for 1) after upgrading rails from 3.1.1 to 3.1.3但我使用authlogic和我使用的版本在升级rails后没有更改。

唯一有趣的是我的整个测试套件通过,除了一个请求/集成规范,通过创建一个新用户的过程。当我甚至无法访问开发中的页面时,我的请求规范工作正常,这似乎很奇怪。

关于我能做些什么来达到这个底部的任何想法?

回答

2

看起来您的New Relic插件可能需要更新为新版本。在您的堆栈跟踪中,第一行来自插件文件夹中的New Relic代码。从他们的网站,它看起来像他们发布了新的Rails 3.1的特定代码:

http://blog.newrelic.com/2011/07/29/for-the-active-record-new-relic-support-for-rails-3-1-is-here/

在博客中,他们谈论的变化的ActiveRecord做记录的方式,以及你的异常触发的log_with_instrumentation方法。

它看起来像现在,你应该安装它作为宝石,而不是一个插件: https://github.com/newrelic/rpm

希望这有助于。

+0

谢谢领先。我会看看 – dchapman 2012-03-16 15:51:44

+0

不错的工作。取出新的relic插件修复了一切 – dchapman 2012-03-16 15:55:33

相关问题