Skip to content

joshsoftware/BoxApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BoxApp

Maintainability

Test Coverage

Ruby Version - 2.6.5

Rails Version - 6.0

Postgres Database Installation

  1. Add PostgreSQL Apt Repository
    sudo apt-get install wget ca-certificates
    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

  2. Add the repository to your system
    RELEASE=$(lsb_release -cs) echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list

  3. Install PostgreSQL
    sudo apt-get update
    sudo apt -y install postgresql-11

Configuration of Postgres for Rails

  1. Go to /etc/postgresql/11/main directory

  2. Change permission of pg_hba.conf file
    sudo chmod 777 pg_hba.conf

  3. Open pg_hba.conf file
    Change peer to md5 in "local" is for Unix domain socket connections only line and save the file.

  4. Change password of postgres role
    sudo su - postgres
    psql \password
    enter new password

  5. Create a new role for test database
    sudo su - postgres
    psql
    CREATE ROLE role_name WITH PASSWORD "your_password";
    ALTER ROLE role_name WITH superuser;

  6. Bundle Install If pg gemfile error occurs use
    sudo apt-get install libpq-dev

  7. Set up Env Variables
    Add these lines in .bashrc file
    export LEVEL_ME_UP_USERNAME="postgres"
    LEVEL_ME_UP_PASSWORD="your_password_set_in_step_4"
    POSTGRES_11_PORT="5432"
    export LEVEL_ME_UP_DEV="database_name"

  8. Create Database
    Go to project directory
    rails db:create

  9. Run Migration
    rails db:migrate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published