在Heroku上进行行为标记 [英] acts-as-taggable-on on Heroku

查看:81
本文介绍了在Heroku上进行行为标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直使用行为作为标记标记在我的开发应用程序中,但是当我将它推到Heroku时,出现一个令人讨厌的错误:

  ActionView :: TemplateError(PGError :错误:关系tags不存在
:SELECT标记。*,taggings.tags_count AS count FROMtagsJOIN(SELECT taggings.tag_id,COUNT(taggings.tag_id)AS tags_count FROMtaggingsINNER JOIN提供ON offers.id = taggings.taggable_id WHERE(taggings.taggable_type = E'Offer'AND taggings.context = E'tags')GROUP BY taggings.tag_id HAVING COUNT(*)> 0 AND COUNT(taggings.tag_id)> ; 0)在app / views / offers / index.html.erb的第29行:
26:< div id =sidebar>; 0)AS taggings ON taggings.tag_id = tags.id)
27:<! - < h3>热门标签< / h3>
28:
29:<%tag_cloud(@tags,%w(css1 css2 css3 css4))do | tag,css_class | %GT;
30:<%link_to tag.name,{:action => :tag,:id => tag.name},:class => css_class%>
31:<%end%> - >
32:

app / views / offers / index.html.erb:29
app / controllers / offers_controller.rb:11:in`index'
/ home / heroku_rack / lib / static_assets.rb:9:在`call'
/home/heroku_rack/lib/last_access.rb:15:in`call'
/ home / heroku_rack / lib / date_header。 rb:14:在`call'
thin(1.2.6)lib / thin / connection.rb:76:在`pre_process'
thin(1.2.6)lib / thin / connection.rb: 74:在`catch'
thin(1.2.6)lib / thin / connection.rb:74:在`pre_process'
thin(1.2.6)lib / thin / connection.rb:57:在'process'中
thin(1.2.6)lib / thin / connection.rb:42:在`receive_data'
eventmachine(0.12.10)lib / eventmachine.rb:256:`run_machine'
eventmachine(0.12.10)lib / eventmachine.rb:256:在`run'中
thin(1.2.6)lib / thin / backends / base.rb:57:在`start'
thin(1.2.6)lib / thin / server.rb:156:在`start'
thin(1.2.6)lib / thin / controllers / controller.rb:80:在`start'
thin(1.2.6)lib / thin / r unner.rb:177:在`send'
thin(1.2.6)lib / thin / runner.rb:177:在`run_command'
thin(1.2.6)lib / thin / runner。 rb:143:'run!'
thin(1.2.6)bin / thin:6
/usr/ruby1.8.7/bin/thin:19:in`load'
/ usr / ruby​​1.8.7 / bin / thin:19

有谁知道如何让插件工作关于Heroku的PostgreSQL?



谢谢!

解决方案

你的开发数据库可以在heroku上生成:
heroku rake db:push

但是你可能真正需要(ed)做的是运行迁移
heroku rake db:migrate



祝您好运!


I've been using the acts-as-taggable-on for tagging in my development app, but when I push it to Heroku, I get a nasty error:

ActionView::TemplateError (PGError: ERROR:  relation "tags" does not exist
: SELECT tags.*, taggings.tags_count AS count FROM "tags"  JOIN (SELECT taggings.tag_id, COUNT(taggings.tag_id) AS tags_count FROM "taggings"  INNER JOIN offers ON offers.id = taggings.taggable_id WHERE (taggings.taggable_type = E'Offer' AND taggings.context = E'tags')  GROUP BY taggings.tag_id HAVING COUNT(*) > 0 AND COUNT(taggings.tag_id) > 0) AS taggings ON taggings.tag_id = tags.id ) on line #29 of app/views/offers/index.html.erb:
26: <div id="sidebar">
27:     <!-- <h3>Popular Tags</h3>
28:
29:     <% tag_cloud(@tags, %w(css1 css2 css3 css4)) do |tag, css_class| %>
30:         <% link_to tag.name, { :action => :tag, :id => tag.name }, :class => css_class %>
31:     <% end %> -->
32:

    app/views/offers/index.html.erb:29
    app/controllers/offers_controller.rb:11:in `index'
    /home/heroku_rack/lib/static_assets.rb:9:in `call'
    /home/heroku_rack/lib/last_access.rb:15:in `call'
    /home/heroku_rack/lib/date_header.rb:14:in `call'
    thin (1.2.6) lib/thin/connection.rb:76:in `pre_process'
    thin (1.2.6) lib/thin/connection.rb:74:in `catch'
    thin (1.2.6) lib/thin/connection.rb:74:in `pre_process'
    thin (1.2.6) lib/thin/connection.rb:57:in `process'
    thin (1.2.6) lib/thin/connection.rb:42:in `receive_data'
    eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
    eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
    thin (1.2.6) lib/thin/backends/base.rb:57:in `start'
    thin (1.2.6) lib/thin/server.rb:156:in `start'
    thin (1.2.6) lib/thin/controllers/controller.rb:80:in `start'
    thin (1.2.6) lib/thin/runner.rb:177:in `send'
    thin (1.2.6) lib/thin/runner.rb:177:in `run_command'
    thin (1.2.6) lib/thin/runner.rb:143:in `run!'
    thin (1.2.6) bin/thin:6
    /usr/ruby1.8.7/bin/thin:19:in `load'
    /usr/ruby1.8.7/bin/thin:19

Does anyone know how to get the plugin to work on Heroku's PostgreSQL?

Thanks!

解决方案

The following will mirror your dev DB up to production on heroku: heroku rake db:push

but what you probably really need(ed) to do was run the migration heroku rake db:migrate

Good luck!

这篇关于在Heroku上进行行为标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆