Ruby: Resolving "failed to push some refs to '[...]'"

This documentation is part of the Troubleshooting guide. You can view the complete guide here: Encountering an issue with your Ruby service? The solution is likely here!.

👋 Welcome to the Stackhero documentation!

Stackhero provides a ready-to-use Ruby cloud solution offering a range of advantages, including:

  • Deploy your application within seconds using a simple git push.
  • Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
  • Take advantage of automatic backups, one-click updates, and clear, transparent, and predictable pricing.
  • Enjoy optimal performance and enhanced security thanks to a private, dedicated infrastructure.

Save time and make your life easier: it only takes 5 minutes to try Stackhero's Ruby cloud hosting solution!

This error may appear during deployment:

error: failed to push some refs to '[...]'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

This message indicates that the Git repository on your instance has content that is not present locally. To proceed, you can use the following command to force the synchronisation:

git push -f stackhero main