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 berfungsi dengan baik, tetapi ketika saya melakukan migrasi rake db: migrate itu mendapatkan kesalahan yang perlu menginstal pg client. Di mana saya perlu menginstal klien pg? Bantuan apapun
ruby-on-rails-3
postgresql
heroku
dilshod
sumber
sumber
Jawaban:
Pada sistem berbasis Debian, program klien PostreSQL disediakan oleh postgresql-client-common sebagai tautan simbolis ke
/usr/share/postgresql-common/pg_wrapper
.Jika Anda menginstal paket itu dan mencoba menggunakan salah satu program klien PostgreSQL seperti psql , pg_dump , pg_dumpall , dan pg_restore , pg_wrapper tanpa menginstal paket biner khusus versi, seperti postgresql-client-9.1 , kesalahan ini akan muncul:
Cara termudah untuk memperbaikinya adalah dengan menginstal metapackage postgresql-client . Itu selalu tergantung pada paket klien database yang saat ini didukung untuk PostgreSQL pada sistem berbasis Debian dan itu tergantung pada postgresql-client-common
sudo apt-get install postgresql-client
sumber
sudo apt-get install postgresql-client
melaluiheroku run bash
tidak bekerja? Ia kembalibash: sudo: command not found
. Apa yang kulewatkan di sini?Update 30 Maret 2020
Setuju dengan jawaban yang dipilih, tetapi saya menemukan untuk menginstal postgresql-client-12 pada Ubuntu 18 sedikit lebih terlibat.
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
Lihat referensi ini untuk detailnya.
sumber