我認爲Ruby代碼在heroku上崩潰了我的rails應用程序。同時它在開發中工作。我正在使用HAML。Rails:我的ruby代碼破解heroku
= @sold
- @sold.each do |x|
%p lorem
它突破上第二線- @sold.each do |x|
不管@sold等於零,或者如果它具有的值。你們有什麼線索爲什麼?
控制器:
def activity
@user = current_user
@selling = @user.products.where("quantity != ?", 0)
@sold = @user.products.where("quantity == ?", 0)
end
編輯: Heroku的日誌說
"HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
2013-10-21T03:21:40.646768+00:00 app[web.1]: 21: %p one
2013-10-21T03:21:40.646570+00:00 app[web.1]: 20: - @sold.each do |x|
2013-10-21T03:21:40.646570+00:00 app[web.1]: 17: %button Status
2013-10-21T03:21:40.646570+00:00 app[web.1]: 18: %tbody
2013-10-21T03:21:40.646570+00:00 app[web.1]: 19: = @sold
2013-10-21T03:21:40.646768+00:00 app[web.1]: app/views/users/activity.html.haml:20:in `_app_views_users_activity_html_haml___1193554036748909609_69954007105480
'@ sold'的類型是什麼? – josh
您是否確認在Heroku上運行的Ruby版本與您的本地版本相同? – Vidya
@AlainGoldman:HINT行上面是否有任何額外的內容?請向我們展示此消息上方和下方的20行。 –