Rails deployment error

Hi all,
I am trying to deploy an rails basic application, But seems like some of the migrations are pending ,
bundle install; bundle exec rake assets:clean assets:precompile; bundle exec rake db:migrate;

this is currently in my build command, But in the console i only see the details of bundle install, Not any commands after that

Nov 5 11:08:54 PM==> Checking out commit f7f41939bc6f10d2f0c0bf88c37234ca7584d16f in branch main

Nov 5 11:08:56 PM==> Downloading cache…

Nov 5 11:09:06 PM==> Transferred 86MB in 8s. Extraction took 2s.

Nov 5 11:09:10 PM==> Using Ruby version 3.2.0 via /opt/render/project/src/Gemfile.lock

Nov 5 11:09:10 PM==> Docs on specifying a Ruby version: Setting Your Ruby Version – Render Docs

Nov 5 11:09:11 PM==> Running build command ‘bundle install; bundle exec rake assets:precompile; bundle exec rake assets:clean; bundle exec rake db:migrate’…

Nov 5 11:09:11 PMBundle complete! 16 Gemfile dependencies, 57 gems now installed.

Nov 5 11:09:11 PMGems in the groups ‘development’ and ‘test’ were not installed.

Nov 5 11:09:11 PMBundled gems are installed into /opt/render/project/.gems

Nov 5 11:09:24 PM==> Uploading build…

Nov 5 11:09:33 PM==> Build uploaded in 8s

Nov 5 11:09:33 PM==> Build successful :tada:

Nov 5 11:09:35 PM==> Deploying…

Nov 5 11:10:17 PM==> Running ‘bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}’

Nov 5 11:10:19 PM[123] Puma starting in cluster mode…

Nov 5 11:10:19 PM[123] * Puma version: 5.6.9 (ruby 3.2.0-p0) (“Birdie’s Version”)

Nov 5 11:10:19 PM[123] * Min threads: 5

Nov 5 11:10:19 PM[123] * Max threads: 5

Nov 5 11:10:19 PM[123] * Environment: deployment

Nov 5 11:10:19 PM[123] * Master PID: 123

Nov 5 11:10:19 PM[123] * Workers: 2

Nov 5 11:10:19 PM[123] * Restarts: (:heavy_check_mark:) hot (:heavy_multiplication_x:) phased

Nov 5 11:10:19 PM[123] * Preloading application

Nov 5 11:10:27 PM[123] * Listening on http://0.0.0.0:10000

Nov 5 11:10:27 PM[123] Use Ctrl-C to stop

Nov 5 11:10:27 PM[123] - Worker 0 (PID: 126) booted in 0.0s, phase: 0

Nov 5 11:10:27 PM[123] - Worker 1 (PID: 133) booted in 0.0s, phase: 0

Nov 5 11:10:28 PMI, [2024-11-05T17:40:28.082125 #133] INFO – : [2468131b-ac61-4231-8cc3-12ebe6c9f528] Started HEAD “/” for 127.0.0.1 at 2024-11-05 17:40:28 +0000

Nov 5 11:10:28 PMI, [2024-11-05T17:40:28.094544 #133] INFO – : [2468131b-ac61-4231-8cc3-12ebe6c9f528] Processing by PostsController#index as HTML

Nov 5 11:10:29 PMI, [2024-11-05T17:40:29.517654 #133] INFO – : [2468131b-ac61-4231-8cc3-12ebe6c9f528] Rendered posts/index.html.erb within layouts/application (Duration: 1417.3ms | Allocations: 1958)

Nov 5 11:10:29 PMI, [2024-11-05T17:40:29.517746 #133] INFO – : [2468131b-ac61-4231-8cc3-12ebe6c9f528] Rendered layout layouts/application.html.erb (Duration: 1417.5ms | Allocations: 2013)

Nov 5 11:10:29 PMI, [2024-11-05T17:40:29.518057 #133] INFO – : [2468131b-ac61-4231-8cc3-12ebe6c9f528] Completed 500 Internal Server Error in 1423ms (ActiveRecord: 441.7ms | Allocations: 3706)

Nov 5 11:10:29 PMF, [2024-11-05T17:40:29.519542 #133] FATAL – : [2468131b-ac61-4231-8cc3-12ebe6c9f528]

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] ActionView::Template::Error (Mysql2::Error: Table ‘defaultdb.posts’ doesn’t exist):

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 3:

Posts

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 4:

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 5:

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 6: <% @posts.each do |post| %>

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 7: <%= render post %>

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 8:

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] 9: <%= link_to “Show this post”, post %>

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528]

Nov 5 11:10:29 PM[2468131b-ac61-4231-8cc3-12ebe6c9f528] app/views/posts/index.html.erb:6

Nov 5 11:10:36 PM==> Your service is live :tada:

Nov 5 11:10:37 PMI, [2024-11-05T17:40:37.119891 #133] INFO – : [6a541d1b-d42e-43f8-abfd-84f8d943244e] Started GET “/” for 162.158.41.41 at 2024-11-05 17:40:37 +0000

Nov 5 11:10:37 PMI, [2024-11-05T17:40:37.120646 #133] INFO – : [6a541d1b-d42e-43f8-abfd-84f8d943244e] Processing by PostsController#index as HTML

Nov 5 11:10:37 PMI, [2024-11-05T17:40:37.562263 #133] INFO – : [6a541d1b-d42e-43f8-abfd-84f8d943244e] Rendered posts/index.html.erb within layouts/application (Duration: 441.0ms | Allocations: 314)

Nov 5 11:10:37 PMI, [2024-11-05T17:40:37.562359 #133] INFO – : [6a541d1b-d42e-43f8-abfd-84f8d943244e] Rendered layout layouts/application.html.erb (Duration: 441.1ms | Allocations: 345)

Nov 5 11:10:37 PMI, [2024-11-05T17:40:37.562490 #133] INFO – : [6a541d1b-d42e-43f8-abfd-84f8d943244e] Completed 500 Internal Server Error in 442ms (ActiveRecord: 220.7ms | Allocations: 543)

Nov 5 11:10:37 PMF, [2024-11-05T17:40:37.563288 #133] FATAL – : [6a541d1b-d42e-43f8-abfd-84f8d943244e]

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] ActionView::Template::Error (Mysql2::Error: Table ‘defaultdb.posts’ doesn’t exist):

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 3:

Posts

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 4:

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 5:

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 6: <% @posts.each do |post| %>

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 7: <%= render post %>

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 8:

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] 9: <%= link_to “Show this post”, post %>

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e]

Nov 5 11:10:37 PM[6a541d1b-d42e-43f8-abfd-84f8d943244e] app/views/posts/index.html.erb:6

I’d suggest doing your migrations in the pre-deploy command section.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.