0

I'm on Ubuntu 10.04, how to fix this error?

When I use bundle install command, this install the necessary gems for run the app with rails s.

But "bundle install" command fails too.

I don´t understand the console prompt, can somebody help me?

antonio@antonio-desktop:~/Descargas/ecozap$ gem install pg -v 0.15.1
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/rvm/rubies/ruby-1.9.3-p484/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config

extconf failed, exit code 1

Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p484/gems/pg-0.15.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p484/extensions/x86-linux/1.9.1/pg-0.15.1/gem_make.out

When I used the sudo apt-get install libpq-dev, I´m getting the following error:

antonio @ antonio-desktop: ~ / Downloads / ECOZAP $ sudo apt-get install libpq-dev
[sudo] password for antonio: 
E: Failed to lock / var / lib / dpkg / lock - open (11: Resource temporarily unavailable) 
E: Unable to lock the administration directory (/ var / lib / dpkg /), maybe there is another process using it?
Antonio Morales
  • 1,044
  • 2
  • 16
  • 35
  • 3
    install development headers for the `postgresql` – Малъ Скрылевъ Feb 03 '14 at 12:48
  • also see this question: http://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-pg-gem – thorsten müller Feb 03 '14 at 12:49
  • @thorstenmüller I´m see your question, I have edited the main post. – Antonio Morales Feb 03 '14 at 12:59
  • 4
    @FrankyCutty: This is more an System issue than anything with programming or Rails. See those questions with similar problems (read carefully, this is a bit strange maybe uless you have other programs running right now): http://askubuntu.com/questions/163030/cannot-open-lock-file-var-lib-dpkg-lock-permission-denied-even-using-sudo & http://askubuntu.com/questions/15433/how-do-i-fix-a-could-not-get-lock-var-lib-dpkg-lock-problem & http://ubuntuforums.org/showthread.php?t=2134172 – thorsten müller Feb 03 '14 at 13:06
  • sudo apt-get install libpq-dev – Sachin Singh Feb 03 '14 at 13:55
  • after installing postgresql, have u changed md5 to trust in /etc/postgresql/9.1/main/pb_hba.conf – Rahul Singh Feb 03 '14 at 14:30

1 Answers1

0

All you have to do is close any other package manager that is locking apt and install libpq-dev again.

Paul-Sebastian Manole
  • 2,538
  • 1
  • 32
  • 33