ruby on rails - How to Install Postgresql Gem on Ubuntu -


i have ubuntu 12.04 precise installed via crouton on asus chromebook. have rails application requires postgres. when run "bundle" fails install pg gem. try installing multiple versions of independently , fails. failure report below:

building native extensions. take while... error: error installing pg: error: failed build gem native extension.

/home/oscar/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20150331-16650-11xjo0a.rb extconf.rb checking 

pg_config... yes using config values /usr/bin/pg_config need install postgresql-server-dev-x.y building server-side extension or libpq-dev building client-side application. need install postgresql-server-dev-x.y building server-side extension or libpq-dev building client-side application. checking libpq-fe.h... no can't find 'libpq-fe.h header * extconf.rb failed * not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. 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=/home/oscar/.rvm/rubies/ruby-1.9.3-p551/bin/ruby --with-pg --without-pg --enable-windows-cross --disable-windows-cross --with-pg-config --without-pg-config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib

extconf failed, exit code 1

gem files remain installed in /home/oscar/.rvm/gems/ruby-1.9.3-p551/gems/pg-0.18.1 inspection. results logged /home/oscar/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-linux/1.9.1/pg-0.18.1/gem_make.out

i tried install using brew. files downloaded, , seem install when run "brew upgrade postgresql" says postgresql doesn't exits. out of ideas, , haven't been able find else problem.

as far can tell, says "you need install postgresql-server-dev-x.y building server-side extension or libpq-dev building client-side application" means need install packages on system gems work.

so on fedora had yum install postgresql-devel. since you're on ubuntu think need do

sudo apt-get install libpq-dev 

you may need build-essential run

sudo apt-get install libpq-dev build-essential 

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -