# I can't migrate PostgreSQL by flyctl ssh console -C "/rails/bin/rails db:migrate"

**URL:** <https://community.fly.io/t/i-cant-migrate-postgresql-by-flyctl-ssh-console-c-rails-bin-rails-db-migrate/19460>\
**Category:** Build debugging\
**Tags:** postgres, rails\
**Created:** [April 24, 2024, 11:51am UTC](https://community.fly.io/t/i-cant-migrate-postgresql-by-flyctl-ssh-console-c-rails-bin-rails-db-migrate/19460 "2024-04-24T11:51:02Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![febuiles](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/febuiles/32/35503_2.png) [@febuiles](https://community.fly.io/u/febuiles)\
**Post date:** [April 26, 2024, 2:10pm UTC](https://community.fly.io/t/i-cant-migrate-postgresql-by-flyctl-ssh-console-c-rails-bin-rails-db-migrate/19460/21 "2024-04-26T14:10:26Z")

</div>

@minorex16 That’s very odd, can you post the output of `fly deploy`? If that fails, [the documentation](https://fly.io/docs/rails/getting-started/existing/#common-initial-deployment-issues) has information on commonly found problems.

If `fly deploy` is working as expected: do you see the same behavior if you try to launch a new app with `fly launch`?

---

<div class="post-metadata">

**Author:** ![minorex16](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/minorex16/32/37974_2.png) [@minorex16](https://community.fly.io/u/minorex16)\
**Post date:** [April 26, 2024, 3:19pm UTC](https://community.fly.io/t/i-cant-migrate-postgresql-by-flyctl-ssh-console-c-rails-bin-rails-db-migrate/19460/22 "2024-04-26T15:19:57Z")

</div>

```auto
fly deploy . --app tacticanote-postgres --image flyio/postgres-flex:15.6
==> Verifying app config
Validating /Users/minorisugimura/TacticaChat/fly.toml
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'flyio/postgres-flex:15.6' remotely...
image found: img_dozgpe8dx301p096

Watch your deployment at https://fly.io/apps/tacticanote-postgres/monitoring

It looks working as expected.
-------
Updating existing machines in 'tacticanote-postgres' with rolling strategy

-------
 ✔ Machine 1857559c441d18 [app] update succeeded

```

---

<div class="post-metadata">

**Author:** ![febuiles](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/febuiles/32/35503_2.png) [@febuiles](https://community.fly.io/u/febuiles)\
**Post date:** [April 27, 2024, 7:45am UTC](https://community.fly.io/t/i-cant-migrate-postgresql-by-flyctl-ssh-console-c-rails-bin-rails-db-migrate/19460/23 "2024-04-27T07:45:55Z")

</div>

@minorex16 Thanks for providing the logs.

I think the problem is you’re deploying a VM with a Postgres image, so it makes sense that the `bin/rails` executable is not in your machines, it only has access to what comes with the PostgreSQL dockerfile.

Your `fly.toml` does not specify an application running in HTTP(S) (port 80/443) either, so my suggestion if possible would be to remove the existing `fly.toml` and then run `fly launch` again to generate a new TOML file with the proper Rails configuration. This document provides more guidance: [Existing Rails Apps · Fly Docs](https://fly.io/docs/rails/getting-started/existing/#provision-rails-and-postgres-servers). Hope this helps!

[Previous page](https://community.fly.io/t/i-cant-migrate-postgresql-by-flyctl-ssh-console-c-rails-bin-rails-db-migrate/19460.md?page=1)
