获取错误:部署到heroku时必须至少安装一个postgresql-client-< version>package

xwmevbvl  于 2022-11-13  发布在  PostgreSQL
关注(0)|答案(4)|浏览(176)
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工作正常,但当我做迁移rake db:migrate它得到错误,需要安装pg客户端.我需要在哪里安装pg客户端?任何帮助

g52tjvyc

g52tjvyc1#

在基于Debian的系统上,PostreSQL客户端程序由postgresql-client-common提供,作为/usr/share/postgresql-common/pg_wrapper的符号链接。
如果您安装该软件包并尝试使用任何PostgreSQL客户端程序(如psqlpg_dumppg_dumpallpg_restore),则在未安装版本特定二进制软件包(如postgresql-client-9.1)的情况下,pg_wrapper将发出以下错误:
您必须至少安装一个postgresql-client-< version >package
最简单的解决方法是安装postgresql-client元包。它总是依赖于基于Debian的系统上当前支持的PostgreSQL数据库客户端包,并且它依赖于postgresql-client-common

sudo apt-get install postgresql-client
roejwanj

roejwanj2#

更新日期:2020年3月30日

同意选择的答案,但我发现在Ubuntu 18上安装postgresql-client-12稍微复杂一些。

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

有关详细信息,请参阅this reference

um6iljoc

um6iljoc3#

对于Ubuntu 18.04.6 LTS,它只使用两个命令;

sudo apt-get install postgresql-client-common

sudo apt-get install postgresql-client
wpcxdonn

wpcxdonn4#

使用新版本postgresql 14,我跟踪了此文档
http://apt.postgresql.org/pub/repos/apt/README

$ sudo su - 

$ lsb_release -c

Codename:       focal

$ echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list

$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-client-14

相关问题