无法将true转换为String

编程入门 行业动态 更新时间:2024-10-27 22:25:31
本文介绍了无法将true转换为String的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我认为我的缓存存在一些问题.

I'm having some problem with what I think is my cache.

我收到此错误消息:

ListsUsersController# (ActionView::Template::Error) "can't convert true into String"

这是代码:

%footer - cache "footer-movies-#{Time.now.hour.to_s}", expires_in: 2.days do .foot-movies %ul - Movie.footer.each do |movie| %li= link_to (image_tag movie.poster, size: "60x92"), movie_path(movie), title: movie.title

它在抱怨第40行,这是包含.foot-movies的行.

It's complaining about line 40, which is the line containing .foot-movies.

该代码大多数时候都可以工作,但有时会出现此错误. 一段时间以来,我还没有看到自己的情况,但是异常告诉我该错误已引发500多个最近7天的时间.

The code works most of the time, but sometimes raises this error. I've not seen it my self in a while, but Exceptional tells me that the error has been raised over 500 times the last 7 days.

我正在使用:

  • haml 3.1.2
  • rails 3.1
  • memcached 1.4.5
  • dalli 1.0.5

此处是完整的堆栈跟踪.

推荐答案

您拥有的其中一个变量或方法中没有字符串,其简单的'true'和ruby不会将其转换为字符串.您必须找出其中的哪一个,并确保其传递正确的值

One of the variables or methods you have doesn't have a string in it its simply 'true' and ruby wont convert that to a string. You'd have to hunt down which of these it is and make sure its passing the right value

更多推荐

无法将true转换为String

本文发布于:2023-11-10 02:54:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574147.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:转换为   true   String

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!