Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Heroku support `rails dbconsole`?

Tags:

I'm trying to fire up rails dbconsole on Heroku but get the following error:

heroku run rails dbconsole # => Couldn't find database client: psql. Check your $PATH and try again 

Is it possible to use the dbconsole on Heroku? If not is there another client that can be used?

like image 802
Peter Nixey Avatar asked Feb 04 '12 18:02

Peter Nixey


People also ask

Does heroku support rails 7?

Ruby on Rails is a popular web framework written in Ruby. This guide covers using Rails 7 on Heroku. For information on running previous versions of Rails on Heroku, see the tutorial for Rails 6. x or Rails 5.


2 Answers

https://devcenter.heroku.com/articles/heroku-postgresql - "You must have PostgreSQL installed on your system to use heroku pg:psql". So maybe you're missing PostgreSQL on your machine. If that's not the case, then try this other command to get to the Postgres console instead:

heroku pg:psql  

"psql is the native PostgreSQL interactive terminal and is used to execute queries and issue commands to the connected database."

like image 127
konyak Avatar answered Sep 30 '22 06:09

konyak


I think heroku-sql-console should provide similar functionality, but when I tried running it I got this error:

 undefined local variable or method `app' for # (NameError) 

It's been reported as a bug but there's no fix or workaround.

Update: As @Alban suggests, the fix to this problem is to update the client. I had to run gem update heroku to do this.

like image 37
Luke Girvin Avatar answered Sep 30 '22 05:09

Luke Girvin