2017-03-25 74 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

相关问题