You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rpm -i http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
yum -y install postgresql92-server postgresql92-contrib postgresql92-devel
yum -y install postgresql-devel # this is for gem pg
service postgresql-9.2 initdb
chkconfig postgresql-9.2 on
service postgresql-9.2 restart
# Create the user
sudo -u postgres psql
create user <username> with password '<password>';
create database myapp_production owner <username>;
ALTER ROLE <username> SUPERUSER;# Needed if your app needs to install extensions# Change PG login
vi /var/lib/pgsql/9.2/data/pg_hba.conf
# Change the bottom lines from Ident to md5# TYPE DATABASE USER CIDR-ADDRESS METHOD# "local" is for Unix domain socket connections onlylocal all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Restart the service
service postgresql-9.2 restart
Setting DB credentials in environment - 12 Factors app
As Rails database.yml does not load the environment yet, it is very tricky to add environment variables