[英]ActionView::Template::Error (undefined method 'code' for nil:NilClass)
My app runs perfectly on my local server but returns the error below when I try to push it to heroku: 我的应用程序可以在本地服务器上完美运行,但是当我尝试将其推送到heroku时返回以下错误:
ActionView::Template::Error (undefined method 'code' for nil:NilClass)
The method 'code'
is the title of the first column in my SQLite database and is used to search for products in a search bar which are then graphed on my app. 方法
'code'
是我的SQLite数据库中第一列的标题,用于在搜索栏中搜索产品,然后将其绘制在我的应用程序上。
Anyone know what could be causing this? 有人知道是什么原因造成的吗?
It's really hard to tell without seeing any code, but more than likely, somewhere you're doing 很难不看任何代码就很难分辨,但是很有可能在您正在执行的某处
some_variable.code
and this variable is nil. 这个变量为nil What's probably happening is that you haven't added data into your production database (on Heroku) that you have in your development (local) database, which is causing this variable to be
nil
on Heroku. 可能正在发生的事情是,您尚未将开发(本地)数据库中的数据添加到生产数据库(在Heroku中),这导致该变量在Heroku上为
nil
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.