追踪并修复 Rails 3 中的 i18n 弃用警告(应该归咎于 Cucumber 0.9.3?)

发布于 2024-09-30 06:19:52 字数 253 浏览 0 评论 0原文

我的黄瓜测试通过了,但留下了这个荒谬的堆栈跟踪。只是您的基本 I18n 消息中的 {{key}} 插值语法已被弃用。请改用 %{key}。 错误消息,但我如何在该列表中找到罪魁祸首?

我自己从未使用过 {{key}} 语法,所以我使用的一些 gem 已经过时了。请告诉我是哪一个。每次运行测试时都会遇到这么多麻烦,这真的很令人沮丧。

My cucumber test passes, but leaves this ridiculous stack trace. Just your basic The {{key}} interpolation syntax in I18n messages is deprecated. Please use %{key} instead. error message, but how am I to find the culprit in that list?

I never used the {{key}} syntax myself, so some gem I'm using is outdated. Please tell me which one. It's really frustrating to have so much kruft every time I run a test.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

总以为 2024-10-07 06:19:52

我在 Authlogic 中遇到了这个错误,结果发现最新版本的 I18n gem(我认为是 0.4.x)已弃用该调用。

我通过将 I18n gem“回滚”到版本 0.3.7 来避免这个问题。

至于哪个插件,猜测这是关键行(要点上的第 15 行):

/Library/Ruby/Gems/1.8/gems/responders-0.6.0/lib/responders/flash_responder.rb:115:in `设置闪光消息!

因为它是 I18n 行之后的第一个,所以我怀疑它是使用已弃用的插值调用翻译的。

(几分钟后更新):

查看: http://github.com/plataformatec/responders/ commits/master,...看起来您可以升级到responders 0.6.2。他们 6 月 24 日的承诺似乎解决了这个问题。

I was getting that error with Authlogic and it turned out that the more recent versions of the I18n gem (0.4.x, I think) deprecated the call.

I avoided the problem by "rolling back" my I18n gem to version 0.3.7.

As to which plugin, at a guess this is the key line (line 15 on your gist):

/Library/Ruby/Gems/1.8/gems/responders-0.6.0/lib/responders/flash_responder.rb:115:in `set_flash_message!

Since it is the first one that is after the I18n lines, I suspect it is the one that is calling translate with the deprecated interpolation.

(Update a few minutes later):

Looking at: http://github.com/plataformatec/responders/commits/master, ...it looks like you could just upgrade to responders 0.6.2. Their commit on June 24th seems to address the issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文