Travis CI: FATAL: role does not exist

风格不统一 提交于 2019-11-29 05:44:47

For the record, put something like this in your .travis.yml:

before_script:
  - psql -c "CREATE USER skateparks WITH PASSWORD 'skateparks';" -U postgres

Your database.yml has this:

development:
  adapter: postgresql
  encoding: utf8
  database: skateparks_development
  username: skateparks
  password:
  template: template0 # Required for UTF8 encoding

Note the username: skateparks part. Either drop that or create the role with something like:

create role skateparks login

from the psql shell.

This worked for me

from bash...

createuser blog

from psql prompt

ALTER USER blog CREATEDB;

my database.yml

development:
  adapter: postgresql
  encoding: unicode
  database: blog_development
  pool: 5
  username: blog
  password:
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!