I can not convert sqlite rails app to postgres (for deploy heroku)

2

I have tried to do the conversion of a Rails app in sqlite to postgres in order to upa it in heroku, following this heroku's own tutorial: link

But when I create a DB using rake db:create , I get this error message:

  

rake db: create

     

FATAL: "caiograco" role does not exist

("caiograco" is my username in Linux. I do not know how it was for that)

    
asked by anonymous 16.11.2015 / 19:46

1 answer

0

As this answer in the SOen you should add the username to your database.yml , could very well use the name of your application (or some variant of the name) as the username, I will use app_name as a placeholder:

development:
  adapter: postgresql
  encoding: utf8
  database: app_development
  pool: 5
  username: app_name
  password:

You should also create the same "role" user in PostgreSQL using psql:

$ psql -d postgres
postgres=# create role app_name login createdb;
postgres=# \q

The first line runs on your terminal, the following are inside postgres. Then after this try to execute rake db:create .

    
16.11.2015 / 20:43