rails 使用postgresql 10,Centos7
安全起来挺麻烦的,为了您可以少走弯路,也方便自己以后查阅
安装官方源
yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
找到pg_config 文件 centos7 应该在 /usr/pgsql-10/bin/pg_config, 引用它安装pg
修改 hda文件,要不然peer认证很恶心
改为md5
理论上可以了,配置一下 config/database.yml
production:
<<: *default
encoding: unicode
adapter: postgresql
database: **
host: 127.0.0.1
pool: 5
username: ****
password: *****