Ruby on rails 3 获取错误:必须至少安装一个postgresql客户端-<;版本>;部署到heroku时的包 sdilshod@sdilshod-Lenovo-B590:~/webapp/saturn$heroku run rake db:migrate 正在运行附加到终端的“rake db:migrate”。。。起来,跑 弃用警告:在供应商/插件中有Rails 2.3风格的插件!对这些插件的支持将在Rails 4.0中删除。将它们移出并打包到您的Gemfile中,或者将它们作为lib/myplugin/*和config/initializers/myplugin.rb折叠到您的应用程序中。有关这方面的更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2- 0-rc2-已发布。(从at/app/Rakefile:7调用) 弃用警告:在供应商/插件中有Rails 2.3风格的插件!对这些插件的支持将在Rails 4.0中删除。将它们移出并打包到您的Gemfile中,或者将它们作为lib/myplugin/*和config/initializers/myplugin.rb折叠到您的应用程序中。有关这方面的更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2- 0-rc2-已发布。(从at/app/Rakefile:7调用) 错误:必须至少安装一个postgresql客户端程序包。 雷克流产了! 转储数据库时出错 /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:415:in'block(3层)in' /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active\u record/railties/databases.rake:188:in“block(2层)in” /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:182:in“block(2层)in” 任务:TOP=>db:structure:dump (通过使用--trace运行任务查看完整跟踪)

Ruby on rails 3 获取错误:必须至少安装一个postgresql客户端-<;版本>;部署到heroku时的包 sdilshod@sdilshod-Lenovo-B590:~/webapp/saturn$heroku run rake db:migrate 正在运行附加到终端的“rake db:migrate”。。。起来,跑 弃用警告:在供应商/插件中有Rails 2.3风格的插件!对这些插件的支持将在Rails 4.0中删除。将它们移出并打包到您的Gemfile中,或者将它们作为lib/myplugin/*和config/initializers/myplugin.rb折叠到您的应用程序中。有关这方面的更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2- 0-rc2-已发布。(从at/app/Rakefile:7调用) 弃用警告:在供应商/插件中有Rails 2.3风格的插件!对这些插件的支持将在Rails 4.0中删除。将它们移出并打包到您的Gemfile中,或者将它们作为lib/myplugin/*和config/initializers/myplugin.rb折叠到您的应用程序中。有关这方面的更多信息,请参阅发行说明:http://weblog.rubyonrails.org/2012/1/4/rails-3-2- 0-rc2-已发布。(从at/app/Rakefile:7调用) 错误:必须至少安装一个postgresql客户端程序包。 雷克流产了! 转储数据库时出错 /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:415:in'block(3层)in' /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active\u record/railties/databases.rake:188:in“block(2层)in” /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/active_record/railties/databases.rake:182:in“block(2层)in” 任务:TOP=>db:structure:dump (通过使用--trace运行任务查看完整跟踪),ruby-on-rails-3,postgresql,heroku,Ruby On Rails 3,Postgresql,Heroku,heroku pg:psql工作正常,但当我迁移rake db:migrate时,会出现需要安装pg客户端的错误。我需要在哪里安装pg客户端?关于基于Debian的系统的任何帮助,PostreSQL客户端程序由postgresql client common提供,作为指向/usr/share/postgresql common/pg_wrapper的符号链接 如果您安装该软件包并尝试使用任何PostgreSQL客户端程序,如psql、pg\u dump、pg\u dumpall、以及pg\u r

heroku pg:psql工作正常,但当我迁移rake db:migrate时,会出现需要安装pg客户端的错误。我需要在哪里安装pg客户端?关于基于Debian的系统的任何帮助,PostreSQL客户端程序由postgresql client common提供,作为指向
/usr/share/postgresql common/pg_wrapper
的符号链接

如果您安装该软件包并尝试使用任何PostgreSQL客户端程序,如psqlpg\u dumppg\u dumpall、以及pg\u restore,则pg\u wrapper不会安装特定版本的二进制软件包,与postgresql-client-9.1类似,它将发出以下错误:

您必须至少安装一个postgresql客户端-

修复此问题的最简单方法是安装postgresql客户端元软件包。它始终依赖于基于Debian的系统上当前支持的PostgreSQL数据库客户机包,并且依赖于PostgreSQL客户机公用程序包

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)

2020年3月30日更新

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

sudo apt-get install postgresql-client

有关详细信息,请参阅。

我找到了[1]解决方案并修复了错误[1]:感谢您的回复,jla!看来bug heroku和我发现你很受欢迎。我在命令行上使用psql而不使用heroku搜索“至少一条”错误消息时发现了这一点。找到答案后,我想留下一个特定于Debian的修复程序,为特定于Debian的错误提供一个有效的pg_转储和psql,以替代建议的heroku忽略错误的修复程序。运行
sudo apt get install postgresql client
via
heroku run bash
不起作用?它返回未找到的bash:sudo:command。我在这里遗漏了什么?在Ubuntu20.04中,只有最后一行指令起到了作用。在UbuntuEC2中,这对我来说是有效的
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