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?
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.
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."
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With