1

its been a while since i have used postgresql and deployed an app to Heroku, think I have made an error somewhere with my setup.

I have created my app on Heroku, there is a Hobby Dev database setup (I ran Heroku run rake db:setup) which set up my database, but I'm wondering in my database.yml file do i have an error

default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5

production:
<<: *default
database: my_app_production
username: my_app
password: <%= ENV['MY_APP_DATABASE_PASSWORD'] %>

When I run heroku run rake db:create i get

 FATAL:  permission denied for database
 DETAIL:  User does not have   CONNECT privilege.

Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"databaseName", "username"=>"userName", "password"=>"password", "port"=>5432, "host"=>"hostNamehere"}

I have set the database password using heroku config:set

What have i missed here?

Thanks

3
  • Have you set password for postgres heroku config:set MY_APP_DATABASE_PASSWORd='password' Commented Dec 3, 2015 at 10:54
  • yes i have done that, but i will update that in the question to avoid confusion, thanks Commented Dec 3, 2015 at 10:57
  • can you put the logs you are getting.. or try this .stackoverflow.com/questions/20293895/… Commented Dec 3, 2015 at 11:00

1 Answer 1

4

Heroku ignores your database.yml configuration, they generate one when you deploy your application and they also take care of database creation. All you need to do is heroku run rake db:migrate and maybe a heroku run rake db:seed in case you need to seed your database.

Sign up to request clarification or add additional context in comments.

2 Comments

well that makes everything nice and easy then :-) Thank You
because i need to wait 7 mins before I can accept :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.