Hi, I tried to deploy my rails api app, but it looks like something went wrong and I have no idea about it.
I follow step by step but i cant deploy my app.
rails aborted!
To resolve this issue:
- Has the database name changed? Check your database.yml config has the correct database name.
To create your database, run:
Error release command failed, deployment aborted
my database.yml
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch(“RAILS_MAX_THREADS”) { 5 } %>
development:
<<: *default
database: livornos_development
username: <%= ENV['USERNAME'] %>
password: <%= ENV['PASSWORD'] %>
test:
<<: *default
database: livornos_test
production:
<<: *default
database: livornos
url: <%= ENV['DATABASE_URL'] %>
rubys
January 23, 2023, 2:30am
2
I can deploy using that database.yml, so the problem is elsewhere.
If you are running Rails 6 or later, try changing db:migrate
to db:prepare
in your lib/tasks/fly.rake
.
If you are adventurous, you can try out what I will be releasing next week:
bundle add dockerfile-rails --group development
bin/rails generate dockerfile
If you go this route, you can delete lib/tasks/fly.rake
as it won’t be used. More information can be found here: GitHub - rubys/dockerfile-rails: Provide Rails generators to produce Dockerfiles and related files. , including links to discussions about merging this into Rails 7.1.
it didn’t work for me
Preparing to run: `/rails/bin/docker-entrypoint bin/rails fly:release` as root
2023/01/23 04:19:21 listening on [fdaa:1:2938:a7b:7a:b8b8:c596:2]:22 (DNS: [fdaa::3]:53)
/rails/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:241:in `invoke_prerequisites'
/rails/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/rails/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/rails/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4.1/lib/rails/command.rb:51:in `invoke'
/rails/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.15.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
Tasks: TOP => fly:release
(See full trace by running task with --trace)
Starting clean up.
Error release command failed, deployment aborted
any ideas?