Live demo: https://xleed-blog.herokuapp.com/
Login as Postgres and run the following:
CREATE DATABASE blog_dev;
CREATE DATABASE blog_test;
CREATE ROLE blog_admin WITH LOGIN PASSWORD 'postgres';
ALTER USER blog_admin CREATEDB;
ALTER DATABASE blog_test OWNER TO blog_admin;
ALTER DATABASE blog_dev OWNER TO blog_admin;
Then run the migrations:
bin/rails db:migrate RAILS_ENV=test
bin/rails db:migrate RAILS_ENV=development
Open a rails console and run:
User.new(username: 'JuanP', password: '1234').save
Category.new(name: 'Sports', description: 'News about sports').save
This project uses RSpec, I followed this guide
Other useful link: here
- On Ubuntu 20.04:
An error occurred while installing pg (1.2.3)
. Solved by running:sudo apt-get install libpq-dev ruby-dev