Any help would be appreciated.
Still pretty new to ruby on rails. I probably can't spot my errors.
So my code works on my localhost and I can successfully deploy to heroku. However when try to access the website, the message "We're sorry..." pops up instead of my actual website.
My heroku Logs:
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'
Thank you!
You can not hold pictures in Heroku. Although you managed to place them there, they will disappear.
You can use AWS S3 to store static assets.
https://devcenter.heroku.com/articles/s3
...or if you don't have credit card ( it is necessary for registration ) try use dropbox.
Related
I created an application in Ruby on Rails, and everything is OK on my localhost but it doesn't work on Heroku:
We’re sorry, but something went wrong.
If you are the application owner check the logs for more information.
At the beginning, I had a problem with the database, which was not PostgreSQL, but I fixed the problem.
When I check the logs and can see the problem is:
2020-03-28T12:38:29.235789+00:00 heroku[router]: at=info method=GET path="/" host=olivier-godard.herokuapp.com request_id=840fbcb6-1f17-47f0-9d83-23318df3374d fwd="37.120.204.164" dyno=web.1 connect=1ms service=16ms status=500 bytes=1827 protocol=https
I tried db:migrate, then heroku push master again.
2020-03-28T12:34:20.000000+00:00 app[api]: Build started by user projet.site.2015#gmail.com
2020-03-28T12:35:55.952108+00:00 app[api]: Deploy 930a6879 by user projet.site.2015#gmail.com
2020-03-28T12:35:55.952108+00:00 app[api]: Release v7 created by user projet.site.2015#gmail.com
2020-03-28T12:35:57.080831+00:00 heroku[web.1]: Restarting
2020-03-28T12:35:57.375779+00:00 heroku[web.1]: State changed from up to starting
2020-03-28T12:35:58.799290+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2020-03-28T12:35:58.801702+00:00 app[web.1]: === puma shutdown: 2020-03-28 12:35:58 +0000 ===
2020-03-28T12:35:58.801704+00:00 app[web.1]: - Goodbye!
2020-03-28T12:35:58.801705+00:00 app[web.1]: Exiting
2020-03-28T12:36:01.000000+00:00 app[api]: Build succeeded
2020-03-28T12:36:08.781105+00:00 app[web.1]: => Booting Puma
2020-03-28T12:36:08.781123+00:00 app[web.1]: => Rails 6.0.2.1 application starting in production
2020-03-28T12:36:08.781124+00:00 app[web.1]: => Run `rails server --help` for more startup options
2020-03-28T12:36:10.110905+00:00 heroku[web.1]: State changed from starting to up
2020-03-28T12:36:09.871297+00:00 app[web.1]: Puma starting in single mode...
2020-03-28T12:36:09.871326+00:00 app[web.1]: * Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller
2020-03-28T12:36:09.871327+00:00 app[web.1]: * Min threads: 5, max threads: 5
2020-03-28T12:36:09.871327+00:00 app[web.1]: * Environment: production
2020-03-28T12:36:09.871639+00:00 app[web.1]: * Listening on tcp://0.0.0.0:16317
2020-03-28T12:36:09.872016+00:00 app[web.1]: Use Ctrl-C to stop
2020-03-28T12:38:29.235789+00:00 heroku[router]: at=info method=GET path="/" host=olivier-godard.herokuapp.com request_id=840fbcb6-1f17-47f0-9d83-23318df3374d fwd="37.120.204.164" dyno=web.1 connect=1ms service=16ms status=500 bytes=1827 protocol=https
2020-03-28T12:38:29.222883+00:00 app[web.1]: I, [2020-03-28T12:38:29.222773 #4] INFO -- : [840fbcb6-1f17-47f0-9d83-23318df3374d] Started GET "/" for 37.120.204.164 at 2020-03-28 12:38:29 +0000
2020-03-28T12:38:29.225673+00:00 app[web.1]: I, [2020-03-28T12:38:29.225603 #4] INFO -- : [840fbcb6-1f17-47f0-9d83-23318df3374d] Processing by PagesController#home as HTML
2020-03-28T12:38:29.231929+00:00 app[web.1]: I, [2020-03-28T12:38:29.231848 #4] INFO -- : [840fbcb6-1f17-47f0-9d83-23318df3374d] Rendering pages/home.html.erb within layouts/application
2020-03-28T12:38:29.233977+00:00 app[web.1]: I, [2020-03-28T12:38:29.233904 #4] INFO -- : [840fbcb6-1f17-47f0-9d83-23318df3374d] Rendered shared/_navbar.html.erb (Duration: 0.5ms | Allocations: 248)
2020-03-28T12:38:29.234403+00:00 app[web.1]: I, [2020-03-28T12:38:29.234329 #4] INFO -- : [840fbcb6-1f17-47f0-9d83-23318df3374d] Rendered pages/home.html.erb within layouts/application (Duration: 2.4ms | Allocations: 1253)
2020-03-28T12:38:29.234656+00:00 app[web.1]: I, [2020-03-28T12:38:29.234595 #4] INFO -- : [840fbcb6-1f17-47f0-9d83-23318df3374d] Completed 500 Internal Server Error in 9ms (Allocations: 2442)
2020-03-28T12:38:29.235754+00:00 app[web.1]: F, [2020-03-28T12:38:29.235690 #4] FATAL -- : [840fbcb6-1f17-47f0-9d83-23318df3374d]
2020-03-28T12:38:29.235754+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] ActionView::Template::Error (The asset "data_1" is not present in the asset pipeline.):
2020-03-28T12:38:29.235755+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 10: </div>
2020-03-28T12:38:29.235756+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 11: </div>
2020-03-28T12:38:29.235756+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 12: <div class="bloc-image">
2020-03-28T12:38:29.235757+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 13: <%= image_tag 'data_1', class: "image-svg" %>
2020-03-28T12:38:29.235757+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 14: </div>
2020-03-28T12:38:29.235758+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 15: <div id="presentation">
2020-03-28T12:38:29.235758+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] 16: <div class="bloc-presentation">
2020-03-28T12:38:29.235759+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d]
2020-03-28T12:38:29.235759+00:00 app[web.1]: [840fbcb6-1f17-47f0-9d83-23318df3374d] app/views/pages/home.html.erb:13
2020-03-28T12:38:29.725103+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=olivier-godard.herokuapp.com request_id=6212842c-bbdb-438f-9d86-5515322c140f fwd="37.120.204.164" dyno=web.1 connect=0ms service=6ms status=200 bytes=143 protocol=https
2020-03-28T12:39:41.252676+00:00 app[api]: Starting process with command `bundle exec rake db:migrate` by user projet.site.2015#gmail.com
2020-03-28T12:39:49.767859+00:00 heroku[run.7053]: State changed from starting to up
2020-03-28T12:39:58.708611+00:00 heroku[run.7053]: State changed from up to complete
2020-03-28T12:40:12.950852+00:00 heroku[router]: at=info method=GET path="/" host=olivier-godard.herokuapp.com request_id=63685b73-070a-4b79-89a2-be5a41dc6197 fwd="37.120.204.164" dyno=web.1 connect=1ms service=5ms status=500 bytes=1827 protocol=https
2020-03-28T12:40:12.944252+00:00 app[web.1]: I, [2020-03-28T12:40:12.944150 #4] INFO -- : [63685b73-070a-4b79-89a2-be5a41dc6197] Started GET "/" for 37.120.204.164 at 2020-03-28 12:40:12 +0000
2020-03-28T12:40:12.944998+00:00 app[web.1]: I, [2020-03-28T12:40:12.944934 #4] INFO -- : [63685b73-070a-4b79-89a2-be5a41dc6197] Processing by PagesController#home as HTML
2020-03-28T12:40:12.945750+00:00 app[web.1]: I, [2020-03-28T12:40:12.945692 #4] INFO -- : [63685b73-070a-4b79-89a2-be5a41dc6197] Rendering pages/home.html.erb within layouts/application
2020-03-28T12:40:12.946106+00:00 app[web.1]: I, [2020-03-28T12:40:12.946054 #4] INFO -- : [63685b73-070a-4b79-89a2-be5a41dc6197] Rendered shared/_navbar.html.erb (Duration: 0.2ms | Allocations: 61)
2020-03-28T12:40:12.946464+00:00 app[web.1]: I, [2020-03-28T12:40:12.946413 #4] INFO -- : [63685b73-070a-4b79-89a2-be5a41dc6197] Rendered pages/home.html.erb within layouts/application (Duration: 0.6ms | Allocations: 273)
2020-03-28T12:40:12.946616+00:00 app[web.1]: I, [2020-03-28T12:40:12.946565 #4] INFO -- : [63685b73-070a-4b79-89a2-be5a41dc6197] Completed 500 Internal Server Error in 2ms (Allocations: 593)
2020-03-28T12:40:12.947553+00:00 app[web.1]: F, [2020-03-28T12:40:12.947494 #4] FATAL -- : [63685b73-070a-4b79-89a2-be5a41dc6197]
2020-03-28T12:40:12.947554+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] ActionView::Template::Error (The asset "data_1" is not present in the asset pipeline.):
2020-03-28T12:40:12.947554+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 10: </div>
2020-03-28T12:40:12.947554+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 11: </div>
2020-03-28T12:40:12.947555+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 12: <div class="bloc-image">
2020-03-28T12:40:12.947555+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 13: <%= image_tag 'data_1', class: "image-svg" %>
2020-03-28T12:40:12.947556+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 14: </div>
2020-03-28T12:40:12.947556+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 15: <div id="presentation">
2020-03-28T12:40:12.947556+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] 16: <div class="bloc-presentation">
2020-03-28T12:40:12.947557+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197]
2020-03-28T12:40:12.947557+00:00 app[web.1]: [63685b73-070a-4b79-89a2-be5a41dc6197] app/views/pages/home.html.erb:13
2020-03-28T12:40:13.363954+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=olivier-godard.herokuapp.com request_id=bf6a8a8f-e44c-4fd9-987a-5112f0abe117 fwd="37.120.204.164" dyno=web.1 connect=1ms service=1ms status=304 bytes=48 protocol=https
2020-03-28T12:40:55.000000+00:00 app[api]: Build started by user projet.site.2015#gmail.com
2020-03-28T12:42:34.099779+00:00 app[api]: Release v8 created by user projet.site.2015#gmail.com
2020-03-28T12:42:34.099779+00:00 app[api]: Deploy 7f608ab3 by user projet.site.2015#gmail.com
2020-03-28T12:42:35.818867+00:00 heroku[web.1]: Restarting
2020-03-28T12:42:35.896985+00:00 heroku[web.1]: State changed from up to starting
2020-03-28T12:42:36.945354+00:00 app[web.1]: - Gracefully stopping, waiting for requests to finish
2020-03-28T12:42:36.945876+00:00 app[web.1]: === puma shutdown: 2020-03-28 12:42:36 +0000 ===
2020-03-28T12:42:36.945908+00:00 app[web.1]: - Goodbye!
2020-03-28T12:42:36.946038+00:00 app[web.1]: Exiting
2020-03-28T12:42:41.000000+00:00 app[api]: Build succeeded
2020-03-28T12:42:58.009374+00:00 app[web.1]: => Booting Puma
2020-03-28T12:42:58.009404+00:00 app[web.1]: => Rails 6.0.2.1 application starting in production
2020-03-28T12:42:58.009405+00:00 app[web.1]: => Run `rails server --help` for more startup options
2020-03-28T12:43:00.239967+00:00 heroku[web.1]: State changed from starting to up
2020-03-28T12:43:00.025594+00:00 app[web.1]: Puma starting in single mode...
2020-03-28T12:43:00.025627+00:00 app[web.1]: * Version 4.3.3 (ruby 2.6.5-p114), codename: Mysterious Traveller
2020-03-28T12:43:00.025628+00:00 app[web.1]: * Min threads: 5, max threads: 5
2020-03-28T12:43:00.025628+00:00 app[web.1]: * Environment: production
2020-03-28T12:43:00.025952+00:00 app[web.1]: * Listening on tcp://0.0.0.0:45616
2020-03-28T12:43:00.026326+00:00 app[web.1]: Use Ctrl-C to stop
2020-03-28T12:44:43.389577+00:00 app[web.1]: I, [2020-03-28T12:44:43.389449 #4] INFO -- : [69de93ec-c402-4332-b7ff-25992a45d6af] Started GET "/" for 37.120.204.164 at 2020-03-28 12:44:43 +0000
2020-03-28T12:44:43.392427+00:00 app[web.1]: I, [2020-03-28T12:44:43.392363 #4] INFO -- : [69de93ec-c402-4332-b7ff-25992a45d6af] Processing by PagesController#home as HTML
2020-03-28T12:44:43.402094+00:00 app[web.1]: I, [2020-03-28T12:44:43.401999 #4] INFO -- : [69de93ec-c402-4332-b7ff-25992a45d6af] Rendering pages/home.html.erb within layouts/application
2020-03-28T12:44:43.405439+00:00 app[web.1]: I, [2020-03-28T12:44:43.405351 #4] INFO -- : [69de93ec-c402-4332-b7ff-25992a45d6af] Rendered shared/_navbar.html.erb (Duration: 0.9ms | Allocations: 248)
2020-03-28T12:44:43.406306+00:00 app[web.1]: I, [2020-03-28T12:44:43.406204 #4] INFO -- : [69de93ec-c402-4332-b7ff-25992a45d6af] Rendered pages/home.html.erb within layouts/application (Duration: 4.0ms | Allocations: 1253)
2020-03-28T12:44:43.406670+00:00 app[web.1]: I, [2020-03-28T12:44:43.406575 #4] INFO -- : [69de93ec-c402-4332-b7ff-25992a45d6af] Completed 500 Internal Server Error in 14ms (Allocations: 2442)
2020-03-28T12:44:43.407830+00:00 app[web.1]: F, [2020-03-28T12:44:43.407758 #4] FATAL -- : [69de93ec-c402-4332-b7ff-25992a45d6af]
2020-03-28T12:44:43.407831+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] ActionView::Template::Error (The asset "data_1" is not present in the asset pipeline.):
2020-03-28T12:44:43.407832+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 10: </div>
2020-03-28T12:44:43.407832+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 11: </div>
2020-03-28T12:44:43.407834+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 12: <div class="bloc-image">
2020-03-28T12:44:43.407848+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 13: <%= image_tag 'data_1', class: "image-svg" %>
2020-03-28T12:44:43.407848+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 14: </div>
2020-03-28T12:44:43.407849+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 15: <div id="presentation">
2020-03-28T12:44:43.407849+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] 16: <div class="bloc-presentation">
2020-03-28T12:44:43.407850+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af]
2020-03-28T12:44:43.407851+00:00 app[web.1]: [69de93ec-c402-4332-b7ff-25992a45d6af] app/views/pages/home.html.erb:13
2020-03-28T12:44:43.410088+00:00 heroku[router]: at=info method=GET path="/" host=olivier-godard.herokuapp.com request_id=69de93ec-c402-4332-b7ff-25992a45d6af fwd="37.120.204.164" dyno=web.1 connect=32ms service=29ms status=500 bytes=1827 protocol=https
2020-03-28T12:44:43.958483+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=olivier-godard.herokuapp.com request_id=e89ec38b-151b-4324-bd42-5fea9a706326 fwd="37.120.204.164" dyno=web.1 connect=4ms service=9ms status=200 bytes=143 protocol=https
I don't understand how to fix it.
At the very end of your logs, you can see the error. It is a bit hard to read with all the extra information, but I extracted it for you.
ActionView::Template::Error (The asset "data_1" is not present in the asset pipeline.):
10: </div>
11: </div>
12: <div class="bloc-image">
13: <%= image_tag 'data_1', class: "image-svg" %>
14: </div>
15: <div id="presentation">
16: <div class="bloc-presentation">
app/views/pages/home.html.erb:13
On heroku, the image_tags don't work, if you don't give the file extension for the picture. (It does work on localhost, so that is why you didn't catch it earlier).
So here, just change the file extension, so that it is like this (with jpg or svg or whatever it is).
<%= image_tag 'data_1.svg', class: "image-svg" %>
I signed up on my rails app on heroku and get the following error on my heroku logs. Meanwhile, the user has been saved to the database.
Anyone with advise on how to proceed pls. I am using devise gem, tried both Puma and Thin servers. Still get the same error. App location is at: https://naijasinglesmeet.herokuapp.com
Sign up for an account and this is what I get in my logs below:
Please advise
2019-10-08T19:55:38.458871+00:00 app[web.1]: I, [2019-10-08T19:55:26.203972 #4] INFO -- : [41600c35-8749-48f2-9c8a-8428f4a92dea] Completed 200 OK in 10ms (Views: 7.5ms | ActiveRecord: 0.0ms)
2019-10-08T19:55:38.458873+00:00 app[web.1]: I, [2019-10-08T19:55:38.298348 #4] INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Started POST "/users" for 41.217.104.185 at 2019-10-08 19:55:38 +0000
2019-10-08T19:55:38.458875+00:00 app[web.1]: I, [2019-10-08T19:55:38.299628 #4] INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Processing by RegistrationsController#create as HTML
2019-10-08T19:55:38.45889+00:00 app[web.1]: I, [2019-10-08T19:55:38.299753 #4] INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Parameters: {"utf8"=>"✓", "authenticity_token"=>"amK9Wje7yZ2DJDtylpzVrY9HrYgc7pmtBMnbl/lrdU5/dW+A00CGgDAW8uAtyfiUDF0tvSZtCt56gOeZsmO+mA==", "user"=>{"username"=>"iamyinka", "first_name"=>"Yinka", "last_name"=>"Ash", "email"=>"iamhere#yinka.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}, "commit"=>"Sign up"}
2019-10-08T19:55:38.458892+00:00 app[web.1]: D, [2019-10-08T19:55:38.458466 #4] DEBUG -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] (0.7ms) BEGIN
2019-10-08T19:55:38.993261+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=naijasinglesmeet.herokuapp.com request_id=6561ef3b-42df-48a4-a227-6d9aa163b5c9 fwd="41.217.104.185" dyno=web.1 connect=0ms service=1ms status=304 bytes=62 protocol=https
2019-10-08T19:55:41.320556+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.02
2019-10-08T19:55:41.348659+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.79MB sample#memory_rss=79.75MB sample#memory_cache=0.04MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8805pages sample#memory_quota=512.00MB
2019-10-08T19:56:02.581435+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.01
2019-10-08T19:56:02.606547+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.76MB sample#memory_rss=79.75MB sample#memory_cache=0.01MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8813pages sample#memory_quota=512.00MB
2019-10-08T19:56:22.544894+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.01
2019-10-08T19:56:22.576747+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.76MB sample#memory_rss=79.75MB sample#memory_cache=0.01MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8813pages sample#memory_quota=512.00MB
2019-10-08T19:56:43.65213+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#load_avg_1m=0.01 sample#load_avg_5m=0.03
2019-10-08T19:56:43.68744+00:00 heroku[web.1]: source=web.1 dyno=heroku.148955966.114d5aad-5be9-43d4-9b68-1c16025c2349 sample#memory_total=79.76MB sample#memory_rss=79.75MB sample#memory_cache=0.01MB sample#memory_swap=0.00MB sample#memory_pgpgin=29231pages sample#memory_pgpgout=8813pages sample#memory_quota=512.00MB
Hi guys.... Here's an update... finally, I see something come up...
2019-10-08T20:25:08.263845+00:00 app[web.1]: D, [2019-10-08T19:55:38.481415 #4] DEBUG -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] (1.9ms) COMMIT
2019-10-08T20:25:08.263848+00:00 app[web.1]: I, [2019-10-08T19:55:38.492062 #4] INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Rendering devise/mailer/confirmation_instructions.html.erb
2019-10-08T20:25:08.26385+00:00 app[web.1]: I, [2019-10-08T19:55:38.494157 #4] INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Rendered devise/mailer/confirmation_instructions.html.erb (2.0ms)
2019-10-08T20:25:08.263853+00:00 app[web.1]: D, [2019-10-08T19:55:38.494327 #4] DEBUG -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Devise::Mailer#confirmation_instructions: processed outbound mail in 12.1ms
2019-10-08T20:25:08.263855+00:00 app[web.1]: I, [2019-10-08T19:55:38.494606 #4] INFO -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] Completed 500 Internal Server Error in 195ms (ActiveRecord: 14.8ms)
2019-10-08T20:25:08.263857+00:00 app[web.1]: F, [2019-10-08T19:55:38.496369 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]
2019-10-08T20:25:08.26386+00:00 app[web.1]: F, [2019-10-08T19:55:38.496444 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):
2019-10-08T20:25:08.263862+00:00 app[web.1]: F, [2019-10-08T19:55:38.496669 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] 2:
2019-10-08T20:25:08.263864+00:00 app[web.1]: [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] 3: <p>You can confirm your account email through the link below:</p>
2019-10-08T20:25:08.263866+00:00 app[web.1]: [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] 4:
2019-10-08T20:25:08.263867+00:00 app[web.1]: [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] 5: <p><%= link_to 'Confirm my account', confirmation_url(#resource, confirmation_token: #token) %></p>
2019-10-08T20:25:08.263869+00:00 app[web.1]: F, [2019-10-08T19:55:38.496775 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67]
2019-10-08T20:25:08.26387+00:00 app[web.1]: F, [2019-10-08T19:55:38.496845 #4] FATAL -- : [bf3b49db-ec4a-4bde-ae56-c5ae727b5f67] app/views/devise/mailer/confirmation_instructions.html.erb:5:in `_app_views_devise_mailer_confirmation_instructions_html_erb__3272380372352870108_47027054750980'
The relevant part of the error message is the following:
[2019-10-08T19:55:38.492062 #4] Rendering devise/mailer/confirmation_instructions.html.erb
[2019-10-08T19:55:38.496444 #4] FATAL -- :ActionView::Template::Error (Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true):
So you mailing template is trying to render, but throws an ActionView::Template::Error and actually tells you the problem:
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true)
So you are using a link_to in your email, that one of course has to know the hostname, in order to create a full url. So you need to define that hostname somewhere.
For example you can set it in config/environments/production.rb by including
config.action_controller.default_url_options = {:host => "naijasinglesmeet.herokuapp.com"}
This is because your application does not know under which host/domain it is running, you have to tell it that.
A little tip, if you run into such problems, run heroku logs --tail, this will give you a continous logs as if you were using the development server.
I have a voting platform that I'm building for my company and I am very close to finishing it but the actual voting is failing while in production. I've done all my migrating and everything, and it's still working in development.
Here are the logs I'm receiving from heroku:
2019-01-11T18:33:59.235681+00:00 app[web.1]: I,
[2019-01-11T18:33:59.235579 #4] INFO -- :
[772bc37c-00ee-43da-aa81-564d353553bb] Started POST
"/ballots/13/votes" for 75.150.214.2 at 2019-01-11 18:33:59 +0000
2019-01-11T18:33:59.236373+00:00 app[web.1]: I,
[2019-01-11T18:33:59.236296 #4] INFO -- :
[772bc37c-00ee-43da-aa81-564d353553bb] Processing by
VotesController#create as HTML 2019-01-11T18:33:59.236437+00:00
app[web.1]: I, [2019-01-11T18:33:59.236378 #4] INFO -- :
[772bc37c-00ee-43da-aa81-564d353553bb] Parameters: {"utf8"=>"✓",
"authenticity_token"=>"Y/vAh2kYPskozS2yQn3Ky1fOq41abLUjlxho0Q+zXHSndVlaSfwYz7bdoqvintdBXrYNDhsbIduYICpUAx3/0g==",
"user_vote"=>"Why", "vote"=>{"comment"=>""}, "commit"=>"Cast Vote",
"ballot_id"=>"13"} 2019-01-11T18:33:59.239540+00:00 app[web.1]: D,
[2019-01-11T18:33:59.239464 #4] DEBUG -- :
[772bc37c-00ee-43da-aa81-564d353553bb] Ballot Load (0.7ms) SELECT
"ballots".* FROM "ballots" WHERE "ballots"."id" = $1 LIMIT $2 [["id",
13], ["LIMIT", 1]] 2019-01-11T18:33:59.240333+00:00 app[web.1]: I,
[2019-01-11T18:33:59.240244 #4] INFO -- :
[772bc37c-00ee-43da-aa81-564d353553bb] Completed 500 Internal Server
Error in 4ms (ActiveRecord: 0.7ms) 2019-01-11T18:33:59.240846+00:00
app[web.1]: F, [2019-01-11T18:33:59.240770 #4] FATAL -- :
[772bc37c-00ee-43da-aa81-564d353553bb]
2019-01-11T18:33:59.240917+00:00 app[web.1]: F,
[2019-01-11T18:33:59.240847 #4] FATAL -- :
[772bc37c-00ee-43da-aa81-564d353553bb]
ActiveModel::UnknownAttributeError (unknown attribute 'comment' for
Vote.):' '2019-01-11T18:33:59.240981+00:00 app[web.1]: F,
[2019-01-11T18:33:59.240914 #4] FATAL -- :
[772bc37c-00ee-43da-aa81-564d353553bb]
2019-01-11T18:33:59.241051+00:00 app[web.1]: F,
[2019-01-11T18:33:59.240987 #4] FATAL -- :
[772bc37c-00ee-43da-aa81-564d353553bb]
app/controllers/votes_controller.rb:10:in `create'
2019-01-11T18:34:07.533587+00:00 heroku[run.2070]: State changed from
up to complete bobby#bobby-Al
Here's my code for vote create
def create
#ballot = Ballot.find(params[:ballot_id])
#vote = #ballot.votes.new(user_vote: params[:user_vote], comment: params[:vote][:comment])
#vote.user_id = current_user.id
if !current_user.votes.find_by(ballot_id: params[:ballot_id])
#vote.save
redirect_to ballot_path(params[:ballot_id])
else
flash[:alert] = "You've already voted on this ballot"
redirect_to ballot_path(params[:ballot_id])
end
end
It seems like a migration problem, just make sure to run your migrations for the environment production on heroku like this:
heroku run rake db:migrate
Restart your app
heroku restart --app my_app_name
Important
If you generate a migration that creates a table and make a push to heroku, to add another column to that table you shouldn't modify that one, instead you should create another one for that.
When you run rake db:migrate, rails register that on the table schema_migrations, so if you modify a migrate that is already registered is not going to be executed again. This could be the case, check directly on your database and see if the column is there.
Every time I run the app on Heroku, this is what comes out of the logs:
2018-04-15T22:51:12.806576+00:00 app[web.1]: I, [2018-04-15T22:51:12.806420 #4] INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Started GET "/patients" for 112.205.217.139 at 2018-04-15 22:51:12 +0000
2018-04-15T22:51:12.808307+00:00 app[web.1]: I, [2018-04-15T22:51:12.808235 #4] INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Processing by PatientsController#index as HTML
2018-04-15T22:51:12.811835+00:00 app[web.1]: I, [2018-04-15T22:51:12.811756 #4] INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Rendering patients/index.html.erb within layouts/application
2018-04-15T22:51:15.563600+00:00 heroku[router]: at=info method=GET path="/patients" host=jdent-patrec.herokuapp.com request_id=cd1ed367-c720-4568-ac03-a3b1bec4fc1b fwd="112.205.217.139" dyno=web.1 connect=0ms service=2757ms status=500 bytes=1827 protocol=https
2018-04-15T22:51:15.557887+00:00 app[web.1]: D, [2018-04-15T22:51:15.557726 #4] DEBUG -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] [1m[36mPatient Load (2.7ms)[0m [1m[34mSELECT "patients".* FROM "patients"[0m
2018-04-15T22:51:15.558988+00:00 app[web.1]: I, [2018-04-15T22:51:15.558899 #4] INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Rendered patients/index.html.erb within layouts/application (2747.0ms)
2018-04-15T22:51:15.559386+00:00 app[web.1]: I, [2018-04-15T22:51:15.559271 #4] INFO -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] Completed 500 Internal Server Error in 2751ms (ActiveRecord: 2589.2ms)
2018-04-15T22:51:15.560650+00:00 app[web.1]: F, [2018-04-15T22:51:15.560581 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]
2018-04-15T22:51:15.560736+00:00 app[web.1]: F, [2018-04-15T22:51:15.560661 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] ActionView::Template::Error (PG::UndefinedTable: ERROR: relation "patients" does not exist
2018-04-15T22:51:15.560739+00:00 app[web.1]: LINE 1: SELECT "patients".* FROM "patients"
2018-04-15T22:51:15.560741+00:00 app[web.1]: ^
2018-04-15T22:51:15.560742+00:00 app[web.1]: : SELECT "patients".* FROM "patients"):
2018-04-15T22:51:15.561063+00:00 app[web.1]: F, [2018-04-15T22:51:15.560972 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 22: </thead>
2018-04-15T22:51:15.561066+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 23:
2018-04-15T22:51:15.561067+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 24: <tbody>
2018-04-15T22:51:15.561069+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 25: <% #patients.each do |patient| %>
2018-04-15T22:51:15.561071+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 26: <tr>
2018-04-15T22:51:15.561072+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 27: <td><%= patient.id %></td>
2018-04-15T22:51:15.561074+00:00 app[web.1]: [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] 28: <td><%= patient.first_name %></td>
2018-04-15T22:51:15.561133+00:00 app[web.1]: F, [2018-04-15T22:51:15.561061 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b]
2018-04-15T22:51:15.561200+00:00 app[web.1]: F, [2018-04-15T22:51:15.561139 #4] FATAL -- : [cd1ed367-c720-4568-ac03-a3b1bec4fc1b] app/views/patients/index.html.erb:25:in `_app_views_patients_index_html_erb___2618543925626266733_38249580'
Error pic:
I've been trying to look for the problem for days but to no avail.
Did you recently create this table? If so, try
heroku run rails db:migrate
Running my rails app locally works fine. Then I deployed it to Heroku successfully but when opening the app I get the error:
"We're sorry, but something went wrong.
If you are the application owner check the logs for more information."
I'm new to using Heroku, this is my first deployed app so not completely sure of how everything works. In my heroku logs it says that:
ActionView::Template::Error (Webpacker can't find application.css in
/app/public/packs/manifest.json. Possible causes:
You want to set webpacker.yml value of compile to true for your environment
Webpack has not yet re-run to reflect updates.
You have misconfigured Webpacker's config/webpacker.yml file. unless you are using the webpack -w or the webpack-dev-server.
Your Webpack configuration is not creating a manifest.
Anyone that has had the same problem or has any tips on how to try and solve this?
This is the whole heroku log:
2017-11-19T12:30:56.336758+00:00 app[web.1]: I, [2017-11-19T12:30:56.336675 #4] INFO -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] Started GET "/" for 85.228.31.12 at 2017-11-19 12:30:56 +0000
2017-11-19T12:30:56.338912+00:00 app[web.1]: I, [2017-11-19T12:30:56.338848 #4] INFO -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] Rendered react_view/index.html.erb within layouts/application (0.7ms)
2017-11-19T12:30:56.337434+00:00 app[web.1]: I, [2017-11-19T12:30:56.337362 #4] INFO -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] Processing by ReactViewController#index as HTML
2017-11-19T12:30:56.338062+00:00 app[web.1]: I, [2017-11-19T12:30:56.337995 #4] INFO -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] Rendering react_view/index.html.erb within layouts/application
2017-11-19T12:30:56.339074+00:00 app[web.1]: I, [2017-11-19T12:30:56.339014 #4] INFO -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] Completed 500 Internal Server Error in 2ms
2017-11-19T12:30:56.339692+00:00 app[web.1]: F, [2017-11-19T12:30:56.339632 #4] FATAL -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c]
2017-11-19T12:30:56.339766+00:00 app[web.1]: F, [2017-11-19T12:30:56.339696 #4] FATAL -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] ActionView::Template::Error (Webpacker can't find application.css in /app/public/packs/manifest.json. Possible causes:
2017-11-19T12:30:56.339768+00:00 app[web.1]: 1. You want to set webpacker.yml value of compile to true for your environment
2017-11-19T12:30:56.339770+00:00 app[web.1]: 2. Webpack has not yet re-run to reflect updates.
2017-11-19T12:30:56.339771+00:00 app[web.1]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
2017-11-19T12:30:56.339769+00:00 app[web.1]: unless you are using the `webpack -w` or the webpack-dev-server.
2017-11-19T12:30:56.339772+00:00 app[web.1]: 4. Your Webpack configuration is not creating a manifest.
2017-11-19T12:30:56.339974+00:00 app[web.1]: [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] 3: <%= javascript_pack_tag 'application' %>
2017-11-19T12:30:56.340038+00:00 app[web.1]: F, [2017-11-19T12:30:56.339975 #4] FATAL -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c]
2017-11-19T12:30:56.340104+00:00 app[web.1]: F, [2017-11-19T12:30:56.340050 #4] FATAL -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] app/views/react_view/index.html.erb:2:in `_app_views_react_view_index_html_erb___547572771215860275_34419720'
2017-11-19T12:30:56.339974+00:00 app[web.1]: [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] 4: <%= javascript_pack_tag 'ReactHome' %>
2017-11-19T12:30:56.339773+00:00 app[web.1]: Your manifest contains:
2017-11-19T12:30:56.339775+00:00 app[web.1]: }
2017-11-19T12:30:56.339774+00:00 app[web.1]: {
2017-11-19T12:30:56.339775+00:00 app[web.1]: ):
2017-11-19T12:30:56.339972+00:00 app[web.1]: F, [2017-11-19T12:30:56.339903 #4] FATAL -- : [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] 1: <script>window.__theme = 'bs4';</script>
2017-11-19T12:30:56.339973+00:00 app[web.1]: [0b584fb1-2c9e-41e9-bfe4-19cbf6523a6c] 2: <%= stylesheet_pack_tag 'application' %>
`
I had this error, tried to compile and also got :
$ rake assets:precompile RAILS_ENV=production
...
rails aborted!
No such middleware to insert after: ActionDispatch::Static
Solved it thanks to this thread by turning with an ENV
# config/environments/production.rb
config.public_file_server.enabled=true` # ENV['RAILS_SERVE_STATIC_FILES'].present?