【发布时间】:2012-11-10 04:41:03
【问题描述】:
我们正在使用 Ruby on Rails(带有 MySQL 数据库的 Active Record)。
我们遇到了这个神秘的错误:
undefined method `to_sym' for #<Arel::Attributes::Attribute:0x007f82e4088248>
我查看了我们的 Ruby 代码并在 IRB 中进行了尝试,它似乎可以与 Rails/ActiveRecord 一起使用。
那么上面的错误信息是什么意思,我们该如何解决呢?
谢谢
【问题讨论】:
-
你也可以在这里发布堆栈跟踪吗?
-
在这里,不确定它有多大帮助 app/views/home/_top_collectors.html.erb:2:in
block in _app_views_home__top_collectors_html_erb___1114436438966347956_69885225174440' app/views/home/_top_collectors.html.erb:1:in_app_views_home__top_collectors_html_erb___1114436438966347956_69885225174440' app/views/home/index.html.er: 45:在`_app_views_home_index_html_erb__2079745407266393088_69885433760820' -
很抱歉,您的 _top_collectors.html.erb 文件中有什么内容?至少是它崩溃的地方的代码?我会打赌用 to_sym 进行一些序列化(可能是 to_json 调用)螺丝...
标签: ruby-on-rails activerecord