Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm currently evaluating Nitrous.io and liking what I'm seeing so far. I've currently got a few databases for testing and development running on Heroku's hosted Postgresql service as well. I'm running into some issues when running tests though, and I'm hoping somewhere here may have a solution.

When I run rake db:test:prepare I'm getting the error:

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

From what I've read elsewhere, that's trying to DROP the database, but Heroku's hosted databases don't allow that. Does anyone out there know how to run Rails tests on Heroku's Postgresql?

share|improve this question
    
Why would you try to run tests on heroku? –  Michal Szyndel Jul 31 '13 at 7:01
    
I'm developing on Nitrous.io and they recommend using Heroku's hosted Postgres solution for the database. I mentioned it above, didn't really explain much about Nitrous though I suppose. I'm just trying to see if there's a solution when developing in "the cloud" using Nitrous.io. –  RyanN Jul 31 '13 at 11:40
    
Maybe I'm a moron but I have no idea what this nitrous.io does (and yes, I've looked on their page) –  Michal Szyndel Jul 31 '13 at 13:26
1  
@MichaelSzyndel Basically it allows you to provision a box in the cloud and do development on that box through your browser. That way you can develop no matter what computer you're on without having to worry setting up an environment again. They have a in-browser IDE as well. –  RyanN Jul 31 '13 at 16:19

2 Answers 2

up vote 3 down vote accepted

Nitrous.IO has released a package manager which will allow you to install Postgres within your Nitrous box. This can be used for your test database as well as your development database if needed:

https://github.com/action-io/autoparts

This also requires that you are using a Nitrous box is running version "bran" or later (see README). You may need to terminate/create a new box if you are running on version "arya".

To use autoparts, run parts search to see all of the packages available.

To install postgresql within the Nitrous box, run the following command:

parts install postgresql

share|improve this answer
    
How do I connect a rails app and postgresql via parts? Parts status says postgresql is running but I can rake db:migrate my app. –  cpursley Sep 18 '13 at 20:37
    
Nice feature. I'm having the same issue as cpursley though. When I run rake db:create:all I'm getting "could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?" Any suggestions? –  RyanN Sep 24 '13 at 2:47

According to the Heroku docs, you need to use "heroku pg:reset" in your rake task.

https://devcenter.heroku.com/articles/rake

share|improve this answer
    
Thing is, it's not a heroku site. I'm only using Heroku's Postgres hosted database solution. –  RyanN Jul 31 '13 at 11:38
    
@RyanN But you had to create a Heroku app to get the database, didn't you? –  Michal Szyndel Jul 31 '13 at 13:27
    
@MichaelSzyndel Not, you can provision Heroku databases without hosting an app on Heroku. postgres.heroku.com –  RyanN Jul 31 '13 at 16:18
    
@RyanN I think Scott answer is right. –  Michal Szyndel Jul 31 '13 at 16:26

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.