2011-08-02 44 views
1

我正在关注this教程,并按照步骤部署到HerokuHeroku部署问题

当我打开从Heroku的应用,这是我得到:

Heroku | Welcome to your new app!

为什么没有出现在我的应用程序?

编辑:这是我所得到的,当我运行heroku logs

$ heroku logs 
←[36m2011-07-29T18:08:11+00:00 heroku[api]:←[0m Add-on add logging:basic by [email protected] 
←[36m2011-07-29T18:08:11+00:00 heroku[api]:←[0m Release v1 created by [email protected] 
←[36m2011-07-29T18:08:13+00:00 heroku[api]:←[0m Add-on update shared-database 
←[36m2011-07-29T18:08:13+00:00 heroku[api]:←[0m Release v3 created by [email protected] 
←[33m2011-07-29T18:08:45+00:00 heroku[slugc]:←[0m Slug compilation started 
←[36m2011-07-29T18:09:37+00:00 heroku[api]:←[0m Deploy e04b0d1 by [email protected] 
←[36m2011-07-29T18:09:37+00:00 heroku[api]:←[0m Release v4 created by [email protected] 
←[32m2011-07-29T18:09:39+00:00 heroku[web.1]:←[0m State changed from created to 
starting 
←[33m2011-07-29T18:09:40+00:00 heroku[slugc]:←[0m Slug compilation finished 
←[32m2011-07-29T18:09:41+00:00 heroku[web.1]:←[0m Starting process with command 
`thin -p 59785 -e production -R /home/heroku_rack/heroku.ru start` 
←[32m2011-07-29T18:09:44+00:00 app[web.1]:←[0m >> Maximum connections set to 102 
4 
←[32m2011-07-29T18:09:44+00:00 app[web.1]:←[0m >> Thin web server (v1.2.6 codena 
me Crazy Delicious) 
←[32m2011-07-29T18:09:44+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:59785, CT 
RL+C to stop 
←[32m2011-07-29T18:09:45+00:00 heroku[web.1]:←[0m State changed from starting to 
up 
←[35m2011-07-29T18:10:08+00:00 heroku[rake.1]:←[0m State changed from created to 
starting 
←[35m2011-07-29T18:10:10+00:00 app[rake.1]:←[0m Awaiting client 
←[35m2011-07-29T18:10:11+00:00 heroku[rake.1]:←[0m State changed from starting t 
o up 
←[35m2011-07-29T18:10:11+00:00 heroku[rake.1]:←[0m Process exited 
←[35m2011-07-29T18:10:12+00:00 heroku[rake.1]:←[0m State changed from up to comp 
lete 
←[33m2011-07-29T18:13:55+00:00 heroku[slugc]:←[0m Slug compilation started 
←[36m2011-07-29T18:14:52+00:00 heroku[api]:←[0m Deploy dbed18f by [email protected] 
←[36m2011-07-29T18:14:52+00:00 heroku[api]:←[0m Release v5 created by [email protected] 
←[32m2011-07-29T18:14:52+00:00 heroku[web.1]:←[0m State changed from up to bounc 
ing 
←[32m2011-07-29T18:14:52+00:00 heroku[web.1]:←[0m State changed from bouncing to 
created 
←[32m2011-07-29T18:14:52+00:00 heroku[web.1]:←[0m State changed from created to 
starting 
←[33m2011-07-29T18:14:53+00:00 heroku[slugc]:←[0m Slug compilation finished 
←[32m2011-07-29T18:14:54+00:00 heroku[web.1]:←[0m Stopping process with SIGTERM 
←[32m2011-07-29T18:14:54+00:00 app[web.1]:←[0m >> Stopping ... 
←[32m2011-07-29T18:14:55+00:00 heroku[web.1]:←[0m Process exited 
←[32m2011-07-29T18:14:55+00:00 heroku[web.1]:←[0m Starting process with command 
`thin -p 49961 -e production -R /home/heroku_rack/heroku.ru start` 
←[32m2011-07-29T18:14:58+00:00 app[web.1]:←[0m >> Thin web server (v1.2.6 codena 
me Crazy Delicious) 
←[32m2011-07-29T18:14:58+00:00 app[web.1]:←[0m >> Maximum connections set to 102 
4 
←[32m2011-07-29T18:14:58+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:49961, CT 
RL+C to stop 
←[32m2011-07-29T18:14:59+00:00 heroku[web.1]:←[0m State changed from starting to 
up 
←[35m2011-07-29T18:15:21+00:00 heroku[rake.2]:←[0m State changed from created to 
starting 
←[35m2011-07-29T18:15:24+00:00 heroku[rake.2]:←[0m State changed from starting t 
o up 
←[35m2011-07-29T18:15:25+00:00 heroku[rake.2]:←[0m State changed from up to comp 
lete 
←[32m2011-07-29T18:17:47+00:00 app[web.1]:←[0m 
←[32m2011-07-29T18:17:47+00:00 app[web.1]:←[0m 
←[32m2011-07-29T18:17:47+00:00 app[web.1]:←[0m Started GET "/use 
←[31m←[0m 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m Processing by UsersController#i 
ndex as HTML 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m Completed 500 Internal Server Err 
or in 61ms 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m ActiveRecord::StatementInvalid (P 
GError: ERROR: relation "users" does not exist 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m : SELECT "users".* FROM "users"): 

←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m app/controllers/users_controlle 
r.rb:5:in `index' 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m 
←[32m2011-07-29T18:17:48+00:00 app[web.1]:←[0m 
←[32m2011-07-29T19:18:57+00:00 heroku[web.1]:←[0m Idling 
←[32m2011-07-29T19:18:58+00:00 heroku[web.1]:←[0m State changed from up to down 
←[32m2011-07-29T19:18:58+00:00 heroku[web.1]:←[0m Stopping process with SIGTERM 
←[32m2011-07-29T19:18:58+00:00 app[web.1]:←[0m >> Stopping ... 
←[32m2011-07-29T19:18:59+00:00 heroku[web.1]:←[0m Process exited 
←[35m2011-08-02T07:38:42+00:00 heroku[rake.1]:←[0m State changed from created to 
starting 
←[35m2011-08-02T07:38:44+00:00 app[rake.1]:←[0m Awaiting client 
←[35m2011-08-02T07:38:45+00:00 app[rake.1]:←[0m Starting process with command `r 
ake db:migrate` 
←[35m2011-08-02T07:38:45+00:00 heroku[rake.1]:←[0m State changed from starting t 
o up 
←[35m2011-08-02T07:38:45+00:00 heroku[rake.1]:←[0m Process exited 
←[35m2011-08-02T07:38:46+00:00 heroku[rake.1]:←[0m State changed from up to comp 
lete 
←[33m2011-08-02T07:58:10+00:00 heroku[slugc]:←[0m Slug compilation started 
←[36m2011-08-02T07:59:08+00:00 heroku[api]:←[0m Deploy e5db406 by [email protected] 
←[36m2011-08-02T07:59:08+00:00 heroku[api]:←[0m Release v6 created by [email protected] 
←[33m2011-08-02T07:59:11+00:00 heroku[slugc]:←[0m Slug compilation finished 
←[35m2011-08-02T07:59:44+00:00 heroku[rake.2]:←[0m State changed from created to 
starting 
←[35m2011-08-02T07:59:46+00:00 app[rake.2]:←[0m Awaiting client 
←[35m2011-08-02T07:59:46+00:00 app[rake.2]:←[0m Starting process with command `r 
ake db:migrate` 
←[35m2011-08-02T07:59:47+00:00 heroku[rake.2]:←[0m State changed from starting t 
o up 
←[35m2011-08-02T07:59:48+00:00 heroku[rake.2]:←[0m Process exited 
←[35m2011-08-02T07:59:49+00:00 heroku[rake.2]:←[0m State changed from up to comp 
lete 
←[32m2011-08-02T08:00:27+00:00 heroku[web.1]:←[0m Unidling 
←[32m2011-08-02T08:00:27+00:00 heroku[web.1]:←[0m State changed from down to cre 
ated 
←[32m2011-08-02T08:00:27+00:00 heroku[web.1]:←[0m State changed from created to 
starting 
←[32m2011-08-02T08:00:29+00:00 heroku[web.1]:←[0m Starting process with command 
`thin -p 12972 -e production -R /home/heroku_rack/heroku.ru start` 
←[32m2011-08-02T08:00:32+00:00 app[web.1]:←[0m >> Thin web server (v1.2.6 codena 
me Crazy Delicious) 
←[32m2011-08-02T08:00:32+00:00 app[web.1]:←[0m >> Maximum connections set to 102 
4 
←[32m2011-08-02T08:00:32+00:00 app[web.1]:←[0m >> Listening on 0.0.0.0:12972, CT 
RL+C to stop 
←[32m2011-08-02T08:00:32+00:00 heroku[web.1]:←[0m State changed from starting to 
up 
←[32m2011-08-02T09:01:44+00:00 heroku[web.1]:←[0m Idling 
←[32m2011-08-02T09:01:45+00:00 heroku[web.1]:←[0m State changed from up to down 
←[32m2011-08-02T09:01:46+00:00 heroku[web.1]:←[0m Stopping process with SIGTERM 
←[32m2011-08-02T09:01:46+00:00 app[web.1]:←[0m >> Stopping ... 
←[32m2011-08-02T09:01:46+00:00 heroku[web.1]:←[0m Process exited 

感谢。

+0

它看起来像您已经创建了一个heroku应用程序,但您尚未将其从本地计算机推送到heroku。 – mark

+0

@mark。我实际上做了,就像我跑了:'git push heroku master'。谢谢 – Simplicity

+0

尝试'heroku restart'命令 – NARKOZ

回答

0

您可以使用:

heroku logs 

,看看什么是目前发生在服务器上。

1

从日志看起来你没有迁移数据库,因为它正在寻找一个表用户。在'heroku rake db:migrate VERSION = 0'中输入'heroku rake db:migrate'即可。看看这里的Heroku中的文档

http://devcenter.heroku.com/articles/database

部分的“迁移到PostgreSQL的常见问题”下。此外结帐这个

http://devcenter.heroku.com/articles/using-the-cli

,对于您可以从终端上运行的所有命令。既然你使用的是heroku,试着让你的本地数据库也是postgresql,稍后会解决一些小问题。请记住,每次将文件推送到heroku时,如果您在数据库结构中进行了某些更改,则需要迁移数据库。

0

我认为最简单的事情就是重新开始。进入你的应用程序的根。如myapp并删除git回购。

cd sites 
cd myApp 
git rm -r .git 

然后登录Heroku并销毁CMS中的应用程序。之后,通过进入你的目录创建一个新的heroku rails应用程序,创建一个新的repo,添加你的目录,作为主人,创建一个heroku应用程序,然后推送到heroku。

git init 
git add . 
git commit -m 'master' 

heroku create 
heroku rename myApp 
git push heroku master 

然后,您将需要运行您的迁移。

heroku rake db:migrate 

如果你想从你的本地计算机将数据推到生产,您将要使用的水龙头宝石但一定要添加到您的包。

gem 'taps' 

然后再次运行包。

bundle 

然后你可以推动你的本地数据,如果需要的话。

heroku db:push 
0

升高很晚,但我遇到了这个问题。我错过了工头在我的Gemfile

0

如果你下面的Gemfile中

的railstutorial.org 注释掉源码3(#gem '的sqlite3'),那么:

git add . 

git commit -am "fix heroku" 

git push heroku