Ruby: Troubleshooting

Encountering an issue with your Ruby service? The solution is likely here!

👋 Welcome to the Stackhero documentation!

Stackhero offers a ready-to-use Ruby cloud solution that provides a host of benefits, including:

  • Deploy your application in seconds with a simple git push.
  • Use your own domain name and benefit from the automatic configuration of HTTPS certificates for enhanced security.
  • Enjoy peace of mind with automatic backups, one-click updates, and straightforward, transparent, and predictable pricing.
  • Get optimal performance and robust security thanks to a private and dedicated VM.

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

Stackhero's Ruby cloud hosting service is designed to be user-friendly, but issues may occasionally arise. Below, you will find guidance on resolving common errors.

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

When running git push stackhero main, the following error might occur:

error: src refspec main does not match any
error: failed to push some refs to 'ssh://<XXXXXX>.stackhero-network.com:222/project.git'

This error suggests that the main branch does not exist in your repository. Instead, you might need to push to the master branch:

git push stackhero master

The message Everything up-to-date from Git indicates that no changes have been detected between your local code and the repository on Stackhero.

If you have made changes, ensure they are committed:

git add -A .
git commit -m "Your commit message"
git push stackhero main

If you want to trigger a deployment without any actual code changes, you can create an empty commit:

git commit --allow-empty -m "Force update"
git push stackhero main

An enhanced Makefile version is available to address this scenario automatically. With it, you can deploy simply by running make deploy, even without code modifications.

This error implies that either no Makefile exists in the project's root directory or the Makefile lacks a run target.

To fix this, you can add a Makefile containing the following example:

run:
	rake assets:precompile
	rake db:migrate RAILS_ENV=production
	RAILS_ENV=production bundle exec puma -C config/puma.rb

You may find the enhanced version of the Makefile particularly useful for streamlining development and deployment workflows.

The error *** missing separator in a Makefile typically occurs when a tab character is incorrectly replaced with spaces before a command. In Makefiles, commands must always begin with a tab character.

To fix this, ensure that each command line starts with a proper tab character rather than spaces:

run:
<tab>command

Replace <tab> with a real tab character to resolve the issue.