Skip to content

Setting up the Production Instance

John R. D'Orazio edited this page Aug 2, 2021 · 9 revisions

Here are some notes on the steps I had to take to get the production environment on https://marriagebooklet.bibleget.io up and running.

  1. Clone the github repo to the website directory and initialize the rails app:

    cd /var/www/vhosts/bibleget.io/marriagebooklet.bibleget.io
    git clone [email protected]:opensourcecatholic/marriage-booklet.git .
    bundle
  2. I had to run rails assets:precompile so that the application.css from app/assets/stylesheets would get compiled to public/assets/ (at least I think that's how that works? without this step I was still getting an error that application.css was missing from the asset pipeline)

  3. Now that webpack has been included, I also need to create the public/packs folder and give it the correct permissions, so that rails assets:precompile would be able to successfully compile assets into the public/packs folder. (Since I'm not running as root, I had to make sure the system user was in the same group as the application, i.e. psaserv, and recursively give group write permissions to the public folder: sudo chmod -R g+w public). After that assets were compiled successfully.

  4. Make sure the tmp/cache folder and the public/assets folder both have the correct permissions. After webpack was installed I had to again correct the permissions on all of the subfolders of each of these.

  5. secret_key_base needs to be set for production, run rake secret then copy the last line of output and paste it into an environment variable SECRET_KEY_BASE in the Plesk interface (see for example incomplete response from application from nginx passenger)

  6. If the database schema has been changed, run bin/rails db:migrate RAILS_ENV=production. (Doing this required to set the correct permissions (= g+w) on the /db/production.sqlite3 file.)

     «            GO BACK TO THE PREVIOUS SECTION                     CONTINUE TO THE NEXT SECTION           »      
     4 How tos Home