2013-12-12 31 views
1

我刚刚成功部署到Heroku,但我的应用程序无法正常工作。我是否需要以某种方式迁移数据库或类似的东西?如何在部署后设置或调试Heroku Ruby应用程序

我在本地使用postGreSQL数据库,一切运行正常,但除了推送和看到它部署,我没有做任何更多的事情在设置或迁移Heroku服务器上的数据库,我不知道这是否问题与否?

由于我是新手,因此我不知道所有必需的步骤,但我认为应该尽快进行工作,但是我错过了什么?

我的应用程序似乎是醒着并正确部署的,它对存在不同的页面( - >抱歉,无法正常工作)对不存在的页面有反应( - >“此页面不存在” ),导致我相信页面正在被读取,但是有关部署或数据库设置的方式需要更正。

有人能给我一些明显的地方看看,检查的东西,否则指向我的方向是正确的。是不是一个postGres的问题?不知道如何调试一个Heroku应用程序,它已经被部署后?Thx!

回答

1

你需要什么是heroku run什么 例如:

heroku run rails c 
Running `rails c` attached to terminal... up, run.3434 
Loading production environment (Rails 4.0.0) 
irb(main):001:0> 

你也可以这样做:

heroku logs -t 

到尾巴你的日志

heroku help 
Usage: heroku COMMAND [--app APP] [command-specific-options] 

Primary help topics, type "heroku help TOPIC" for more details: 

    addons # manage addon resources 
    apps  # manage apps (create, destroy) 
    auth  # authentication (login, logout) 
    config # manage app config vars 
    domains # manage custom domains 
    logs  # display logs for an app 
    ps  # manage dynos (dynos, workers) 
    releases # manage app releases 
    run  # run one-off commands (console, rake) 
    sharing # manage collaborators on an app 

Additional topics: 

    account  # manage heroku account options 
    certs  # manage ssl endpoints for an app 
    db   # manage the database for an app 
    drains  # display syslog drains for an app 
    fork   # clone an existing app 
    git   # manage git for apps 
    help   # list commands and display help 
    keys   # manage authentication keys 
    labs   # manage optional features 
    maintenance # manage maintenance mode for an app 
    pg   # manage heroku-postgresql databases 
    pgbackups # manage backups of heroku postgresql databases 
    plugins  # manage plugins to the heroku gem 
    regions  # list available regions 
    stack  # manage the stack for an app 
    status  # check status of heroku platform 
    update  # update the heroku client 
    version  # display version 
1

你需要运行分贝:迁移Heroku的服务器上...

heroku run rake db:migrate

+0

谢谢你,就是这样! –

+0

不客气!如果您愿意,请将其标记为已回答。 :) – Donovan

相关问题