Problema Postgresql
|
|
Estou tentando instalar a gem do postgresql para rodar em minha app ROR. Porém ao tentar instalá-la localmente (Baixei a gem, pois meu proxy bloqueia), gera o seguinte erro: PS: Uso Linux Ubuntu 8.10 Intrepid e Postgresql 8.3 rodando normalmente
Building native extensions. This could take a while...
ERROR: Error installing ruby-pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:1: command not found: pg_config --includedir
extconf.rb:52: command not found: pg_config --libdir
checking for main() in -lpq... no
*** 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/bin/ruby1.8
--with-pgsql-dir
--without-pgsql-dir
--with-pgsql-include
--without-pgsql-include=${pgsql-dir}/include
--with-pgsql-lib
--without-pgsql-lib=${pgsql-dir}/lib
--with-pqlib
--without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/ruby-pg-0.7.9.2008.01.28 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/ruby-pg-0.7.9.2008.01.28/ext/gem_make.out
Obrigado !!! \^/ |
|
|
que comando usou para instalar a gem? Talvez tenha que passar o pgsql-dir… porque ele parece não estar encontrando os comandos do postgre… |
|
|
Sim, neste caso eu estava no diretório, por isso não precisei passar o caminho e nome completo do arquivo.
|
|
|
Instalou o pacote libpq? Se for debian ou ubuntu, deve ser libpq-dev. |
|
|
Não to conseguindo Luizão … quando vai instalar, o apt da um monte de erro de not found, veja: ronaldo@fiberwork-desktop:~/Desktop$ sudo apt-get install libpq-dev [sudo] password for ronaldo: Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: comerr-dev libkadm55 libkrb5-dev libssl-dev Suggested packages: krb5-doc The following NEW packages will be installed: comerr-dev libkadm55 libkrb5-dev libpq-dev libssl-dev 0 upgraded, 5 newly installed, 0 to remove and 7 not upgraded. Need to get 2224kB/2450kB of archives. After this operation, 8098kB of additional disk space will be used. Do you want to continue [Y/n]? Y Err http://security.ubuntu.com intrepid-security/main libkadm55 1.6.dfsg.4~beta1-3ubuntu0.1 404 Not Found Err http://security.ubuntu.com intrepid-security/main libssl-dev 0.9.8g-10.1ubuntu2.5 404 Not Found Err http://security.ubuntu.com intrepid-security/main libkrb5-dev 1.6.dfsg.4~beta1-3ubuntu0.1 404 Not Found Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/k/krb5/libkadm55_1.6.dfsg.4~beta1-3ubuntu0.1_i386.deb 404 Not Found Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl-dev_0.9.8g-10.1ubuntu2.5_i386.deb 404 Not Found Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb5-dev_1.6.dfsg.4~beta1-3ubuntu0.1_i386.deb 404 Not Found E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? \^/ |
|
|
Resolvido pessoal ! Valeu Luizão ! \^/ |
|
|
gem install pg como no outro post ;) |
|
|
Eu tenho a lib instalada corretamente, mas quando eu dou “gem install pg” eu tenho o seguinte: $ gem install pg WARNING: Installing to ~/.gem since /var/lib/gems/1.8 and /var/lib/gems/1.8/bin aren't both writable. WARNING: You don't have /home/laerte/.gem/ruby/1.8/bin in your PATH, gem executables will not run. Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb extconf.rb:1:in `require': no such file to load -- mkmf (LoadError) from extconf.rb:1 Gem files will remain installed in /home/laerte/.gem/ruby/1.8/gems/pg-0.9.0 for inspection. Results logged to /home/laerte/.gem/ruby/1.8/gems/pg-0.9.0/ext/gem_make.out |
|
|
Eu fiz: $ export PATH=/var/lib/gems/1.8/bin:$PATH Daí eu pude instalar o “pg” gem, mas eu ainda recebo o erro: |
|
|
Instalei um tal de ruby-dev e obtenho o mesmo erro. |
|
|
errr.. tu tá usando o rvm? senão tá faltando um sudo aí. |
|
|
Consegui instalar o pg gem, mas eu encontro um erro quando tento criar os databases com o db:create:all |
|
|
Cola o erro aqui! |
|
|
Quando eu tento dar o db:create:all, eu obtenho o seguinte erro: rake aborted! Please install the jdbcpostgresql adapter: `gem install activerecord-jdbcpostgresql-adapter` (no such file to load -- java) Mas eu já instalei esse gem que ele pede… |
|
|
Meu database estava assim: test: Mudei para: test: Agora deu certo, os dabatases foram criados com sucesso. |
|
|
hehhe ! |

