2010-10-11 36 views
1

我一直在使用acts-as-taggable-on在我開發應用程序標記,但是當我把它推到Heroku的,我得到一個討厭的錯誤:行爲-AS-加標籤上在Heroku

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 

有誰知道如何讓插件在Heroku的PostgreSQL上工作?

謝謝!

+1

在你的應用程序中添加acts-as-taggable-on之後你運行過'heroku rake db:migrate'嗎? – 2010-10-11 12:54:02

+0

您是否啓動遷移?因爲它就像你沒有數據庫中的表格 – shingara 2010-10-11 12:54:28

+0

看起來模式存在某種問題......我從頭開始重新加載模式,然後運行我的腳本來加載數據,現在一切都已經結束,跑!謝謝 :-) – Avishai 2010-10-11 13:05:50

回答

1

下面將反映你的dev的DB達產在Heroku: Heroku的耙分貝:推

,但你可能真的需要(ED)做的是運行遷移 Heroku的耙分貝:遷移

祝你好運!

0

我不知道爲什麼,但db:migrate沒有爲我工作,而是我db:schema:加載,現在工作順利。試一試。

相關問題