1

Estou com esse erro ao rodar o bundle install

"An error occurred while installing pg (0.21.0), and Bundler cannot continue. Make sure that `gem install pg -v '0.21.0'` succeeds before bundling. In Gemfile:"

Essa é a gem em meu Gemfile: "gem 'pg', '~> 0.18'"

Tentei rodar gem install pg -v '0.21.0' e então bundle install e recebo

To see why this extension failed to compile, please check the mkmf.log which can be found here: /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.‌​0/pg-0.21.0/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/pg-0.21.0 for inspection. Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.‌​0/pg-0.21.0/gem_make‌​.out

mkmf.log:

erro ao rodar o bundle install::::Fetching pg 0.21.0
Installing pg 0.21.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: 
checking for pg_config... yes
Using config values from /usr/local/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
0

3 Respostas 3

2

Você precisa instalar o pg admin server antes na sua máquina.

sudo apt-get install postgresql postgresql-contrib libpq-dev
3
  • opa, boa tarde...eu já possuo o PgAdmin4 e mesmo assim o erro continua 7/12/2017 às 15:45
  • Já tinha o Pg instalado, mas instalei os pacotes: postgresql-contrib libpq-dev e agora funcionou, obrigado.
    – Sérgio
    27/03/2018 às 8:47
  • No Ubuntu 20.04, apenas o pacote libpq-dev é necessário 10/12/2020 às 20:49
0

Obrigada. me ajudou muito. Foi só executar sudo apt-get install postgresql postgresql-contrib libpq-dev e em seguida bundle install

-3

Se quiser hospedar o BD em outra máquina, não precisa instalar o serviço do postgresql. Bastam as libs. Digite: sudo apt-get install postgresql-contrib libpq-dev

1
  • 1
    Como está escrito atualmente, sua resposta não é clara. Por favor, pode editar para adicionar mais detalhes, que ajudarão outras pessoas a entender como isso resolve a pergunta feita. Você pode encontrar mais informações sobre como escrever boas respostas na Central de Ajuda.
    – Comunidade Bot
    23/03/2022 às 19:09

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .