sdilshod@sdilshod-Lenovo-B590:~/webapp/saturn$ heroku run rake db:migrate
Running `rake db:migrate` attached to terminal... up, run.6194
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2- 0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2- 0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
Error: You must install at least one postgresql-client-<version> package.
rake aborted!
Error dumping database
/app/vendor/bundle/ruby/1.9.1/gems/activerecord- 3.2.12/lib/active_record/railties/databases.rake:415:in `block (3 levels) in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord- 3.2.12/lib/active_record/railties/databases.rake:188:in `block (2 levels) in <top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:182:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:structure:dump
(See full trace by running task with --trace)
heroku pg: psql funciona bem, mas quando eu migro o rake db: migrate, obtém um erro que precisa instalar o pg client. Onde eu preciso instalar o pg client? Qualquer ajuda
ruby-on-rails-3
postgresql
heroku
Dilshod
fonte
fonte
Respostas:
Em um sistema baseado em Debian, os programas clientes PostreSQL são fornecidos pelo postgresql-client-common como links simbólicos para
/usr/share/postgresql-common/pg_wrapper
.Se você instalar esse pacote e tentar usar qualquer um dos programas cliente PostgreSQL como psql , pg_dump , pg_dumpall e pg_restore , o pg_wrapper sem ter o pacote binário específico da versão instalado, como postgresql-client-9.1, ele emitirá este erro:
A maneira mais fácil de consertar isso é instalar o metapacote postgresql-client . Sempre depende do pacote do cliente de banco de dados atualmente suportado para PostgreSQL em sistemas baseados em Debian e depende do postgresql-client-common
sudo apt-get install postgresql-client
fonte
sudo apt-get install postgresql-client
viaheroku run bash
não funciona? Ele retornabash: sudo: command not found
. O que estou perdendo aqui?Atualização em 30 de março de 2020
Concordo com a resposta escolhida, mas descobri que instalar o postgresql-client-12 em um Ubuntu 18 é um pouco mais complicado.
sudo apt update sudo apt -y install vim bash-completion wget sudo apt -y upgrade wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list sudo apt update sudo apt -y install postgresql-client-12
Veja esta referência para detalhes.
fonte