Heroku,问题/问题

bga*_*oci 2 ruby hosting shared-hosting ruby-on-rails

我被称为Heroku for Ruby on Rails托管,到目前为止我认为我真的会喜欢它.只是想知道我是否有人可以帮助我找出问题所在.

我按照那里的说明在那里创建一个应用程序,创建并提交git,推送代码,它显示在http://mylifebattlecry.heroku.com(虽然我所做的大部分是在/ posts/path当我进入一个新的"帖子"(因为这是一个博客平台)时,我得到500.html错误,基本上一切都关闭了.甚至无法返回我输入帖子的页面.

在我看来,数据库设置有问题.我按照他们的建议做了包括... $ heroku rake db:migrate,什么都没有.

只是想知道是否有人知道我做错了什么.以下是他们提供的参考说明:

安装Heroku gem:sudo gem install heroku为你的应用创建一个新的git存储库(如果你还没有):

cd myapp
git init && git add . && git commit -m "first commit"
Run Code Online (Sandbox Code Playgroud)

创建一个新的Heroku应用程序:

heroku create
Created http://sharp-autumn-42.com/ | git@heroku.com:sharp-autumn-42.git
Git remote heroku added
Run Code Online (Sandbox Code Playgroud)

注意:应用程序的名称是自动生成的; 别担心,您可以随时重命名.

部署代码:

git push heroku master
Run Code Online (Sandbox Code Playgroud)

运行迁移(或其他引导任务):

heroku rake db:migrate
Run Code Online (Sandbox Code Playgroud)

在浏览器中打开已部署的应用程序:heroku open

这是.. $ heroku日志,如果有帮助:

brandon-gadocis-macbook-pro:mylifebattlecry bgadoci$ heroku logs -app mylifebattlecry
==> dyno-629271.log <==

==> production.log <==
# Logfile created on Sun Nov 22 18:26:06 -0800 2009

Processing PostsController#index (for 99.7.50.140 at 2009-11-22 18:26:07) [GET]
Rendering template within layouts/posts
Rendering posts/index

ActionView::TemplateError (PGError: ERROR:  column votes.post_id does not exist
LINE 1: SELECT count(*) AS count_all FROM "votes" WHERE ("votes".pos...
                                                         ^
: SELECT count(*) AS count_all FROM "votes" WHERE ("votes".post_id = 1) ) on line #58 of app/views/posts/index.html.erb:
55:                 </div>
56:             <div id="vote"><br/>
57:                 <div id="votes">
58:                     <%= pluralize post.votes.count, 'Person' %>  like the above BattleCry. <br/>
59:                 </div>
60:                 <%= link_to "Comments (#{post.comments.count})", post %>
61:             </div>

    app/views/posts/index.html.erb:58
    app/views/posts/index.html.erb:51
    app/views/posts/index.html.erb:45:in `each'
    app/views/posts/index.html.erb:45
    app/controllers/posts_controller.rb:11:in `index'
    /home/heroku_rack/lib/static_assets.rb:9:in `call'
    /home/heroku_rack/lib/last_access.rb:25:in `call'
    /home/heroku_rack/lib/date_header.rb:14:in `call'
    thin (1.0.1) lib/thin/connection.rb:80:in `pre_process'
    thin (1.0.1) lib/thin/connection.rb:78:in `catch'
    thin (1.0.1) lib/thin/connection.rb:78:in `pre_process'
    thin (1.0.1) lib/thin/connection.rb:57:in `process'
    thin (1.0.1) lib/thin/connection.rb:42:in `receive_data'
    eventmachine (0.12.6) lib/eventmachine.rb:240:in `run_machine'
    eventmachine (0.12.6) lib/eventmachine.rb:240:in `run'
    thin (1.0.1) lib/thin/backends/base.rb:57:in `start'
    thin (1.0.1) lib/thin/server.rb:150:in `start'
    thin (1.0.1) lib/thin/controllers/controller.rb:80:in `start'
    thin (1.0.1) lib/thin/runner.rb:173:in `send'
    thin (1.0.1) lib/thin/runner.rb:173:in `run_command'
    thin (1.0.1) lib/thin/runner.rb:139:in `run!'
    thin (1.0.1) bin/thin:6
    /usr/local/bin/thin:20:in `load'
    /usr/local/bin/thin:20

Rendering /disk1/home/slugs/88382_601a216_9803/mnt/public/500.html (500 Internal Server Error)
Run Code Online (Sandbox Code Playgroud)

小智 9

您确定要对所有表进行迁移吗?

你可以做heroku rake db:schema:加载到只加载一个新的模式