エラー: 少なくとも 1 つの postgresql-client- をインストールする必要があります。 Herokuにデプロイするときにパッケージ化する 質問する

エラー: 少なくとも 1 つの postgresql-client- をインストールする必要があります。 Herokuにデプロイするときにパッケージ化する 質問する
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 クライアントはどこにインストールする必要がありますか? 助けてください

ベストアンサー1

Debianベースのシステムでは、PostreSQLクライアントプログラムは以下によって提供されます。postgresql クライアント共通へのシンボリックリンクとして/usr/share/postgresql-common/pg_wrapper

そのパッケージをインストールして、PostgreSQLクライアントプログラムのいずれかを使用しようとすると、psqlpg_dumppg_dumpall、 そしてpg_restorepg_ラッパーバージョン固有のバイナリパッケージをインストールせずに、postgresql-クライアント-9.1次のエラーが発生します:

少なくとも 1 つの postgresql-client-< バージョン > パッケージをインストールする必要があります。

これを修正する最も簡単な方法は、postgresqlクライアントメタパッケージ。これは常に、Debianベースのシステムで現在サポートされているPostgreSQLのデータベースクライアントパッケージに依存しており、postgresql-client-commonに依存しています。

sudo apt-get install postgresql-client

おすすめ記事