Heroku建立成功,但“我们很抱歉,但出了点问题。”

时间:2018-04-03 12:34:32

标签: ruby-on-rails heroku deployment

任何帮助都将不胜感激。

还是铁杆上的红宝石新手。我可能无法发现我的错误。

所以我的代码在我的localhost上工作,我可以成功部署到heroku。但是,当尝试访问该网站时,会弹出“我们很抱歉......”的消息,而不是我的实际网站。

我的heroku日志:

2018-04-03T12:26:06.139264+00:00 app[web.1]: I, [2018-04-03T12:26:06.139156 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051] Started GET "/" for 66.183.97.241 at 2018-04-03 12:26:06 +0000
2018-04-03T12:26:06.152951+00:00 app[web.1]: I, [2018-04-03T12:26:06.152879 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]   Rendering home/index.html.erb within layouts/application
2018-04-03T12:26:06.154713+00:00 app[web.1]: I, [2018-04-03T12:26:06.154638 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]   Rendered home/_w-menu.html.erb (0.3ms)
2018-04-03T12:26:06.155577+00:00 app[web.1]: I, [2018-04-03T12:26:06.155519 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]   Rendered home/_header.html.erb (0.3ms)
2018-04-03T12:26:06.143890+00:00 app[web.1]: I, [2018-04-03T12:26:06.143817 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051] Processing by HomeController#index as HTML
2018-04-03T12:26:06.156571+00:00 app[web.1]: I, [2018-04-03T12:26:06.156473 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]   Rendered home/index.html.erb within layouts/application (3.4ms)
2018-04-03T12:26:06.156791+00:00 app[web.1]: I, [2018-04-03T12:26:06.156734 #4]  INFO -- : [37787d0f-6494-4e06-9b18-d8ecd9129051] Completed 500 Internal Server Error in 13ms
2018-04-03T12:26:06.157513+00:00 app[web.1]: F, [2018-04-03T12:26:06.157437 #4] FATAL -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]   
2018-04-03T12:26:06.157592+00:00 app[web.1]: F, [2018-04-03T12:26:06.157522 #4] FATAL -- : [37787d0f-6494-4e06-9b18-d8ecd9129051] ActionView::Template::Error (The asset "Events.jpeg" is not present in the asset pipeline.):
2018-04-03T12:26:06.157831+00:00 app[web.1]: F, [2018-04-03T12:26:06.157756 #4] FATAL -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]     53: 			<h1 class="index-titles">Recent Events</h1>
2018-04-03T12:26:06.157839+00:00 app[web.1]: [37787d0f-6494-4e06-9b18-d8ecd9129051]     55: 			<p class="index-content"><strong>Date:</strong> 7:00 PM, ********* 1st | <strong>Location:</strong> ****** *****</p>
2018-04-03T12:26:06.157835+00:00 app[web.1]: [37787d0f-6494-4e06-9b18-d8ecd9129051]     54: 			<h1 class="index-subtitles">**** *th Annual ******* Concert——————————————————</h1>
2018-04-03T12:26:06.157841+00:00 app[web.1]: [37787d0f-6494-4e06-9b18-d8ecd9129051]     56: 			<%= image_tag "Events.jpeg", :style => "display: block; margin: auto; margin-top: 2%; border: 10px solid #E51D39; border-radius: 5%; height: 700px; width: auto;" %>
2018-04-03T12:26:06.157843+00:00 app[web.1]: [37787d0f-6494-4e06-9b18-d8ecd9129051]     58: 		</div>
2018-04-03T12:26:06.157842+00:00 app[web.1]: [37787d0f-6494-4e06-9b18-d8ecd9129051]     57: 			<p class="index-content" style="text-align: center; color: white;"><strong><font size="7em">~ Thank You To All Who Showed Up ~<br>Special Thanks to ****</font></strong></p>
2018-04-03T12:26:06.157845+00:00 app[web.1]: [37787d0f-6494-4e06-9b18-d8ecd9129051]     59: 
2018-04-03T12:26:06.157896+00:00 app[web.1]: F, [2018-04-03T12:26:06.157838 #4] FATAL -- : [37787d0f-6494-4e06-9b18-d8ecd9129051]   
2018-04-03T12:26:06.157985+00:00 app[web.1]: F, [2018-04-03T12:26:06.157912 #4] FATAL -- : [37787d0f-6494-4e06-9b18-d8ecd9129051] app/views/home/index.html.erb:56:in `_app_views_home_index_html_erb___229626976587277798_32272960'

谢谢!

1 个答案:

答案 0 :(得分:0)

你无法在Heroku中保存图片。虽然你设法把它们放在那里,但它们会消失。 您可以使用AWS S3存储静态资产。 https://devcenter.heroku.com/articles/s3

...或者如果您没有信用卡(需要注册),请尝试使用dropbox。