How to set up Postgres database for local Rails project?

前端 未结 3 626
死守一世寂寞
死守一世寂寞 2021-01-30 09:37

I recently got a new machine and would now like to work on my projects from Github. I\'m curious as to how to properly set up the Postgres database on my local machine. I have <

3条回答
  •  無奈伤痛
    2021-01-30 09:41

    firstly, install postgresql

    sudo add-apt-repository ppa:pitti/postgresql
    sudo apt-get update
    
    #now install postgresql
    sudo apt-get install postgresql-9.1 libpq-dev
    
    create a new user in psql
    sudo su postgres
    createuser user_name #Shall the new role be a superuser? (y/n) y
    
    Gemfile
    gem 'pg'
    

    bundle install

    development.yml
    development:
      adapter: postgresql
      database: app_development
      pool: 5
      username: user_name
      password:
    

提交回复
热议问题