查询无法在heroku中工作

时间:2011-02-18 09:42:21

标签: ruby-on-rails-3 heroku

我在我的本地机器上运行它工作正常......但是当我上传到heroku时 我错了

时收到500错误

设置控制器

class SettingsController< ApplicationController的     before_filter:confirm_logged_in

def company
  @company = User.company
  @user_id = session[:user_id]
  @user_name = session[:name]
  @companies = Company.where(:user_id => @user_id)
end


设置视图

<% @companies.each do |company| %>
  <div id="media">
    <span class="lop">    
        <%= image_tag company.logo.url (:small)  %>
    </span>

&lt;%end&gt;

我检查heroku日志这是我得到的......任何想法


2011-02-18T01:09:24-08:00 app[web.1]: Started GET "/settings/company" for 69.137
.99.169 at Fri Feb 18 01:09:24 -0800 2011
2011-02-18T01:09:24-08:00 app[web.1]:   Processing by SettingsController#company
 as HTML
2011-02-18T01:09:24-08:00 app[web.1]: /app/928a2790-dfe4-4726-8793-1fa99837495b/
home/app/views/settings/company.html.erb:14: warning: don't put space before arg
ument parentheses
2011-02-18T01:09:24-08:00 app[web.1]: Rendered settings/_menu.html.erb (2.1ms)
2011-02-18T01:09:24-08:00 app[web.1]: Rendered settings/company.html.erb within
layouts/application (6.8ms)
2011-02-18T01:09:24-08:00 app[web.1]: Completed   in 22ms
2011-02-18T01:09:24-08:00 app[web.1]:
2011-02-18T01:09:24-08:00 app[web.1]: ActionView::Template::Error (PGError: ERRO
R:  operator does not exist: text = integer
2011-02-18T01:09:24-08:00 app[web.1]: LINE 1: ...ompanies".* FROM "companies" WH
ERE "companies"."user_id" = 3
2011-02-18T01:09:24-08:00 app[web.1]:
                          ^
2011-02-18T01:09:24-08:00 app[web.1]: HINT:  No operator matches the given name
and argument type(s). You might need to add explicit type casts.
2011-02-18T01:09:24-08:00 app[web.1]: : SELECT "companies".* FROM "companies" WH
ERE "companies"."user_id" = 3):
2011-02-18T01:09:24-08:00 app[web.1]:     8:     

2011-02-18T01:09:24-08:00 app[web.1]: 9: 2011-02-18T01:09:24-08:00 app[web.1]: 10:

2011-02-18T01:09:24-08:00 app[web.1]: 11: 2011-02-18T01:09:24-08:00 app[web.1]: 12: 2011-02-18T01:09:24-08:00 app[web.1]: 13: 2011-02-18T01:09:24-08:00 app[web.1]: 14: 2011-02-18T01:09:24-08:00 app[web.1]: app/views/settings/company.html.erb:11:i n `_app_views_settings_company_html_erb___121502233_23577600314100_0' 2011-02-18T01:09:24-08:00 app[web.1]: 2011-02-18T01:09:24-08:00 app[web.1]: 2011-02-18T01:09:24-08:00 heroku[router]: GET miso3.heroku.com/settings/company dyno=web.1 queue=0 wait=0ms service=36ms bytes=934 2011-02-18T01:09:24-08:00 heroku[nginx]: GET /settings/company HTTP/1.1 | 69.137 .99.169 | 965 | http | 500 2011-02-18T01:33:03-08:00 app[web.1]: 2011-02-18T01:33:03-08:00 app[web.1]: 2011-02-18T01:33:03-08:00 app[web.1]: Started GET "/settings/company" for 69.137 .99.169 at Fri Feb 18 01:33:03 -0800 2011 2011-02-18T01:33:03-08:00 app[web.1]: Processing by SettingsController#company as HTML 2011-02-18T01:33:03-08:00 app[web.1]: Rendered settings/_menu.html.erb (1.5ms) 2011-02-18T01:33:03-08:00 app[web.1]: Rendered settings/company.html.erb within layouts/application (3.9ms) 2011-02-18T01:33:03-08:00 app[web.1]: Completed in 5ms 2011-02-18T01:33:03-08:00 app[web.1]: 2011-02-18T01:33:03-08:00 app[web.1]: ActionView::Template::Error (PGError: ERRO R: operator does not exist: text = integer 2011-02-18T01:33:03-08:00 app[web.1]: LINE 1: ...ompanies".* FROM "companies" WH ERE "companies"."user_id" = 3 2011-02-18T01:33:03-08:00 app[web.1]: ^ 2011-02-18T01:33:03-08:00 app[web.1]: HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. 2011-02-18T01:33:03-08:00 app[web.1]: : SELECT "companies".* FROM "companies" WH ERE "companies"."user_id" = 3): 2011-02-18T01:33:03-08:00 app[web.1]: 8:

2011-02-18T01:33:03-08:00 app[web.1]: 9: 2011-02-18T01:33:03-08:00 app[web.1]: 10:

2011-02-18T01:33:03-08:00 app[web.1]: 11: 2011-02-18T01:33:03-08:00 app[web.1]: 12: 2011-02-18T01:33:03-08:00 app[web.1]: 13: 2011-02-18T01:33:03-08:00 app[web.1]: 14: 2011-02-18T01:33:03-08:00 app[web.1]: app/views/settings/company.html.erb:11:i n `_app_views_settings_company_html_erb___121502233_23577600314100_0' 2011-02-18T01:33:03-08:00 app[web.1]: 2011-02-18T01:33:03-08:00 app[web.1]: 2011-02-18T01:33:03-08:00 heroku[router]: GET miso3.heroku.com/settings/company dyno=web.1 queue=0 wait=0ms service=20ms bytes=934 2011-02-18T01:33:03-08:00 heroku[nginx]: GET /settings/company HTTP/1.1 | 69.137 .99.169 | 965 | http | 500

0 个答案:

没有答案