Can't rebuild app 'bundle exec rake db:migrate' failed

You want to not do that.

discourse/docs/INSTALL.md at main · discourse/discourse · GitHub

:bell: The only officially supported installs of Discourse are Docker based. You must have SSH access to a 64-bit Linux server with Docker support . We regret that we cannot support any other methods of installation including cpanel, plesk, webmin, etc.