我认为我的缓存存在一些问题.
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
发布评论