Deployment is handled via the
This command deploys the master branch to the production server:
cap production deploy
The staging server can be found at dev.pfadiolten.ch.
Deploy to it with the
cap staging deploy
Development is usually done in a docker container. Use the container with the following commands:
# (re)build the image docker-compose build # start the server docker-compose up # start the server in the background docker-compose up -d
The container saves its database in an external volume. It has to be created before first using the website:
docker volume create --name pfadiolten_home-data -d local
Afterwards, the database has to be created and migrated.
docker-compose run web rails db:create db:migrate
Migrations on an existing database don't require the
docker-compose run web rails db:migrate
Afterwards, the API should be available at
Bugs & Fixes
bcrypt not found, but they are installed
Rails or bundler may throw an error regarding either devise (eg.
class Devise not found and similar) or bcrypt (eg.
unable to load bcrypt_ext and similar).
The fix to this is to reinstall both gems with the explicit platform
gem uninstall devise
gem uninstall bcrypt
gem install bcrypt --platform ruby
gem install devise --platform ruby
It is advised to uninstall all versions of devise and bcrypt, regardless of platform or version. The installation commands may also have to be supplied with a version tag.
Some parts of rails (migrations and others) may still not work correctly even after applying this fix.
ruby as a valid platform for bundler should get rid of all remaining issues.
$ bundle lock --add-platform ruby