2011-08-02 210 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