0
votes

My app runs perfectly on my local server but returns the error below when I try to push it to 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.

Anyone know what could be causing this?

1
Please provide the complete logs for that exception. Are sure that the product is loaded in that view? - Enrique Galindo
Thanks. The complete logs is very long. I don't think the view is the problem as it works fine on my local server. - LogiKal

1 Answers

1
votes

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. 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.