We are using PostgreSQL as databse service After installing it, run in the terminal the following commands.
For Linux:
sudo -u postgres psql
CREATE ROLE "miimosa-jwt" LOGIN CREATEDB PASSWORD 'miimosa-jwt';
On MacOS:
psql postgres
CREATE ROLE "miimosa-jwt" LOGIN CREATEDB PASSWORD 'miimosa-jwt';
Log out from postgres
Ruby version:
2.7.1
Run in the terminal after installing bunlder gem:
bundle install
bundle exec rake db:create db:migrate db:seed
We have a DOCKERFILE for the rails application and a docker-compose to handle a docker image with the rails app and the postgres database.
To build the image and run it:
docker-compose -f docker-compose.yml up --build
After that we need to create databse and populate it:
docker-compose run web rails db:create db:migrate db:seed
Now we can launch newly the services:
docker-compose up
We are using rubocop. We run rubocop on app
and spec
directory
bundle exec rubocop app spec
We are using RSpec, before we need to create database for testing enviroment:
bundle exec rake db:create db:migrate RAILS_ENV=test
bundle exec rspec