2017-03-25 73 views
0

我一直在學習rails一個月左右,我創建了我的第一個簡單的靜態網站在rails上使用ruby。它在localhost:3000上運行良好。爲什麼我的網站不部署在heroku上?

我已將所有文件推送到GitHub上,並且已經關注瞭如何使用GitHub和heroku部署網站的幾個Youtube視頻。我用它們來解決我得到的幾個錯誤,並最終設法「部署」該網站。

但是,我所得到的只是一種歡迎頁面,表示這是我的網站。它只是一個只有「Heroku」的頁面,歡迎使用您的新應用。寫在它上面。我失蹤的最後階段是什麼?爲什麼我沒有看到我的網站?

下面是應用程序日誌:

2017-03-22T20:20:58.057644+00:00 app[api]: Release v1 created by user *******@******.com 

2017-03-22T20:20:58.063330+00:00 app[api]: Release v2 created by user *******@******.com 

2017-03-22T20:20:58.189041+00:00 app[api]: Release v2 created by user *******@******.com 

2017-03-22T20:31:55.915631+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=vast-shelf-39597.herokuapp.com request_id=d69fedea-d149-4836-b349-aa490c3b9654 fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-22T20:31:56.290278+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=vast-shelf-39597.herokuapp.com request_id=0c5752c0-b960-443e-8f07-0c2346055ff9 fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-24T18:44:37.424270+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=vast-shelf-39597.herokuapp.com request_id=62e3ddce-34e5-4fb2-892b-2ae9cf5ca93d fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-24T18:44:37.811237+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=vast-shelf-39597.herokuapp.com request_id=7a5b7d99-1b83-406d-bdc2-c68c3d5efa33 fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-24T18:44:55.237261+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=vast-shelf-39597.herokuapp.com request_id=4057726f-e2b9-464b-a970-b37306051e63 fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-25T20:29:38.837541+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=vast-shelf-39597.herokuapp.com request_id=47282fae-e30f-43d1-be52-808c956cad7b fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-25T21:10:30.120292+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=vast-shelf-39597.herokuapp.com request_id=94863f09-962f-49d5-90db-c0fbf7ac0c8a fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

2017-03-26T11:07:07.914421+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=vast-shelf-39597.herokuapp.com request_id=c3fac4f9-8786-493c-a859-05690842ca89 fwd="88.11.201.253" dyno= connect= service= status=502 bytes= protocol=https 

這裏是我的路線文件:我認爲有一些與「根」的缺失,不是嗎?

Rails.application.routes.draw do 
    get 'handm/home' 
    get 'handm/about' 
    get 'handm/contact' 
    get 'handm/industries' 
    get 'handm/languages' 
    get 'handm/services' 
+1

您可以發送部署屏幕截圖和您的heroku應用程序名稱 –

+0

還可以發佈您的Heroku日誌(轉到您的應用程序,單擊查看日誌)。 – Gerry

+0

我發生過這種情況,因爲我的應用程序不在git repo的根目錄中,我推送到了heroku –

回答

1

看起來像部署很好。

您必須設置應用程序的「根」路線。根路線是用戶第一次訪問您的應用程序時要到達的路線。

我假設家是你想要的第一個路線,如果不是隻是根據需要更改路線文件。

更改此

get 'handm/home' 

這個

root 'handm#home' 

確保推到git的,然後部署到Heroku的。

+0

好的,我已經取得了一些進展。使您建議的更改導致主頁在Web瀏覽器中顯示。但有2件小事。首先其他頁面在點擊時不顯示。它只是進入一個錯誤頁面,指出這個頁面不存在。其次,網站地址是由Heroku生成的。我已經購買了一個域名,並找到一種方法來轉換它。謝謝。 – Owen

+0

是的,你當然可以那樣做 –

+0

我該如何接受答案?將啓動另一個線程 – Owen

相關問題