将 rails 从 3.1.1 升级到 3.1.3 后参数数量错误(3 对 1) [英] wrong number of arguments (3 for 1) after upgrading rails from 3.1.1 to 3.1.3
问题描述
我已将我的 rails 3.1.1 应用程序升级到 rails 3.1.3,现在,对于每个请求,它只回答错误数量的参数(3 for 1)
.不幸的是,它没有说明错误在哪里,并且应用程序跟踪是空的.我认为存在一些兼容性问题,但我真的不知道该从哪里挖掘.
有我的 Gemfile 和框架跟踪:https://gist.github.com/1519479
感谢您的帮助.
运行 bundle show
并检查 omniauth gem 的版本.可能在升级 rails 时你也更新了 omniauth
.
版本 1.*
的 omniauth
需要单独的 gem omniauth-twitter
用于 Twitter 身份验证.由于您的 Gemfile
中没有它,它会尝试从 twitter
gem 中加载为中间件 Twitter
类,这会导致类似的错误.>
为了避免将来出现类似问题,请考虑使用 "~>0.2.6"
进行 gems 版本控制,而不是 ">= 0.2.6"
.它可以保护您免受您正在使用的 gem 的意外重大版本的影响.
I have upgraded my rails 3.1.1 application to rails 3.1.3, and now, on every request, it answers only wrong number of arguments (3 for 1)
. Unfortunately, it doesn't says where the error was, and application trace is empty. I think there's some compatibility problem, but I really don't know where to dig.
There are my Gemfile and a framework trace: https://gist.github.com/1519479
Thanks for any help.
Run bundle show
and check version of omniauth gem. May be while upgrading rails you updated omniauth
as well.
Version 1.*
of omniauth
requires separate gem omniauth-twitter
for twitter authentication. As you don't have it in your Gemfile
it tries to load as middleware Twitter
class from twitter
gem that would cause similar error.
To avoid issues like that in the future consider using "~> 0.2.6"
for gems versioning instead of ">= 0.2.6"
. It protects you from unexpected major releases of gems you're using.
这篇关于将 rails 从 3.1.1 升级到 3.1.3 后参数数量错误(3 对 1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!