Skip to content
ArtOfCode- edited this page Aug 7, 2025 · 1 revision

How exactly you update QPixel will depend on how you installed it in the first place. For instance, if you have the Git repository available, you could pull changes and resolve the resulting merge conflicts with any changes you've made locally; if you have your own fork you've probably already done that in the repository so you may just be able to pull changes directly.

However you obtain updates, there are some steps that need to be followed after each update to ensure everything is updated before restarting your server on the new version.

1. Install dependencies

Gem dependencies are likely to have updated. Run:

bundle install --without development test

Note: The --without flag is deprecated - although this is the method we use currently, once this is removed you will need to use bundle config without beforehand instead.

2. Run migrations

Migrations update your database schema to account for any changes. Run:

RAILS_ENV=production bundle exec rails db:migrate

3. Clear deployment cache keys

Some cached items should be cleared during a deployment so that updated versions will be generated with the new version. A script is provided that clears these keys for you. Run:

RAILS_ENV=production bundle exec rails r scripts/clear_cache.rb

4. Re-seed the database

The database needs to be seeded (like it was when you initialized the site on installation) to add any new items. Run:

RAILS_ENV=production bundle exec rails db:seed

5. Precompile assets

Assets which form part of the Rails pipeline (like CSS and JavaScript) need to be precompiled to generate static versions that can be served by your reverse proxy. Run:

RAILS_ENV=production bundle exec rails assets:precompile

6. Copy static assets

Images aren't precompiled by the Rails pipeline so just need to be copied into the right directory to be served. Run:

cp app/assets/images/* public/assets

7. Update crontab

Scheduled jobs may have been updated, so your crontab file needs to be updated to run them. Run:

RAILS_ENV=production bundle exec whenever --update-crontab

Finalizing

You're now ready to restart your server on the new version. If you're running QPixel as a service, run:

sudo systemctl restart qpixel

If you need to restart Puma directly instead:

RAILS_ENV=production bundle exec pumactl -P tmp/pids/server.pid restart
Clone this wiki locally