-
Notifications
You must be signed in to change notification settings - Fork 4
Home
Refer to
for guidance on setting the project up.
This project uses the simplecov
gem which generates a coverage report each time an RSpec run is completed. The report shows how often each line of code in every file is hit by the tests. Ideally, they should all be hit at least once to make sure the tests are able to catch as many mistakes as possible. The test coverage report can be found at coverage/index.html
.
Unicorn can be restarted using the command /etc/init.d/unicorn_hpi-career_production restart
.
Nginx can be restarted using the command /etc/init.d/nginx restart
.
The most important logs can be found at /var/logs/nginx/error.log
and /var/www/hpi-career/current/log/unicorn.log
.
Important: The SECRET_KEY_BASE
environment variable needs to be set for Unicorn to function correctly. If, for some reason, it becomes unset, the page will display an error message and unicorn.log
will show that SECRET_KEY_BASE
is missing. The following fix works:
/etc/init.d/unicorn_hpi-career_production stop
-
export SECRET_KEY_BASE=...
(A secret key can be generated withbundle exec rake secret
, for example.) /etc/init.d/unicorn_hpi-career_production start
This causes a short downtime, but is unavoidable, as Unicorn retains its environment variables during hot restarts (using restart
). For it to pick up new environent variables, it needs to be shut down fully and started again.
These commands need to be run locally (not on the server).
Step 1: Run bundle update
to update all gems as far as the Gemfile allows. This will update Gemfile.lock
.
Step 2: Run all tests and check if anything stopped working.
Step 3: If everything is fine, commit and push all changes. The next time the project is deployed, Capistrano will automatically update the gems on the server.
This project uses Ruby Version Manager (RVM) to manage the current Ruby version. All of the following commands need to be executed on the server.
Step 1: (Not always needed) If the currently installed version of RVM is out of date, it should be updated.
\curl -sSL https://get.rvm.io | sudo bash -s stable
rvm reload
Step 2: Update to the newest available Ruby version and set it as default.
rvm install 2.x
rvm --default use 2.x
Step 3: Copy the gemset.
rvm gemset copy <previous_version> <new_version>
Done!