Currently I have my Ruby on Rails program running great on my Linux Ubuntu development environment, and now I want to run it live on my website, and get it hosted on Heroku.

The problem is that I don't know how to create a user and a database on Heroku. I have tried the command

heroku run rake db:create

I got the error:

permission denied for database - user does nothave connect privilage

I also tried the command

heroku run su - postgres

and it posted that I need to use the terminal so I do not know how to proceed.

This is my database.yml

default: &default
  adapter:  postgresql
  host:     localhost

development:
  <<: *default
  database: app_development

test:
   <<: *default
   database: app_test

production:
  <<: *default
  database: app_production

How do I set up my database and the proper connections with my Heroku PostgreSQL database?

i also did this

heroku pg:info 

which gave me this

shrouded-reaches-3063 has no heroku-postgresql databases.

also tried this

heroku addons | grep POSTGRES

but nothing was printed

heroku addons:create heroku-postgresql:hobby-dev 
!    `addons:create` is not a heroku command.
!    See `heroku help` for a list of available commands.

also this

heroku pg:wait

and displayed nothing... this really is something T_T really need some major help here , and will be really greatful for any help

share|improve this question
up vote 4 down vote accepted

Have you provisioned a database? What does heroku addons say? You can create an add-on as documented here with heroku addons:create heroku-postgresql:hobby-dev

share|improve this answer
    
I strongly suggest removing your password from your comment. Further, the full command you want is heroku addons:create heroku-postgresql:hobby-dev - see the article here for full info: devcenter.heroku.com/articles/… – elithrar Jul 28 '15 at 9:55
    
heroku addons:create heroku-postgresql:hobby-dev ! addons:create is not a heroku command. ! See heroku help for a list of available commands. – user1868185 Jul 28 '15 at 9:59
    
that is what it returns i have been trying to get this to work all afternoon but to no avail T_T – user1868185 Jul 28 '15 at 9:59
    
in the start i specified that it will use the PG, and its working great locally, but with heroku its now working , it wont even let me create the database T_T – user1868185 Jul 28 '15 at 10:01
1  
Looks like the docs are outdated: try heroku addons:add heroku-postgresql:hobby-dev - note the use of add vs. create. You can also add a DB via the web dashboard, and use tab completion to see available commands when using the Heroku Toolbelt. – elithrar Jul 28 '15 at 12:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.