Ouverture de session

Commentaires récents

Syndication
Flux XML

gem install postgres

gem install postgres
Posté par cote le Mardi, 28 Juillet, 2009 - 6:08pm. Windows

Bonjour,je viens d'installer rails2.3.2 sous windows avec postgres 8.3
et lorsque je veux installer l'adaptateur postgres je me retrouve avec cette erreur :

Quote:
PS C:\Documents and Settings\cote> gem install postgres > toto.txt
ERROR: Error installing postgres:
ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb
checking for main() in /ms/libpq.lib... 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
--srcdir=.
--curdir
--ruby=C:/Ruby/bin/ruby
--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-/ms/libpqlib
--without-/ms/libpqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created

Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/postgres-.7.9.2008.01.28 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/postgres-0.7.9.2008.01.28
ext/gem_make.out

apres quelque recherche sur google j'ai vu qu'on conseillait d'utiliser le gem ruby-postgres il s'installe sans probleme mais en lançant mongrel j'obtiens :

Quote:
PS D:\projet\pnmlweb> ruby D:\projet\pnmlweb\script\server
=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record
connection_adapters/abstract/connection_specificatio
n.rb:76:in `establish_connection': Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`
(182: Le systÞme d'exploitation ne peut pas exÚcuter %1. - C:/Ruby/lib/ruby/gems/1.8/gems/pg-0.8.0-x86-mswin32-60/lib/
pg.so) (RuntimeError)
from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection
_specification.rb:60:in `establish_connection'
from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/connection
_specification.rb:55:in `establish_connection'
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:417:in `initialize_database'
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:141:in `process'
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
from D:/projet/pnmlweb/config/environment.rb:13
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants
_in'
from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from D:/projet/pnmlweb/script/server:3



[ Vous devez vous connecter ou vous enregistrer pour écrire des commentaires | sujet précédent | sujet suivant | envoyer par email ]

Options d'affichage des commentaires
Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder" pour activer vos changements.

Sujet: 
postgres sous windows
Auteur: 
Lanfeust21
Date: 
Mer, 29/07/2009 - 16:17

salut, tu ne devrais normalement pas avoir de soucis

- désinstalle ruby-postgres
- mets à jour rubygem 1.3.5
- et lors de la reinstallation choisit windows.

si tu as certain soucis tu peux copier certaines dll manquantes:
source (http://backyardbamboo.blogspot.com/2008/12/rubys-native-postgres-gem-on-windows.html)

1. go to the http://www.postgresql.org/ftp/binary/ and navigate to the release that matches the Postgres server that you installed.
2. look for and download a file that follows the pattern postgresql-8.X-binaries-no-installer.zip where the X corresponds to the database release
3. unzip the file and navigate to its bin subdirectory
4. copy the following files into your ruby installation's bin directory
5.
* comerr32.dll
* krb5_32.dll
* k5sprt32.dll
* libeay32.dll
* libpq.dll
* libiconv2.dll
* libintl3.dll
* ssleay32.dll
* gssapi32.dll
6. after you have done all that, you should be able to open an interactive ruby session (irb) and type require 'postgres' and get 'true' as a result, i.e., a non-error


[ Vous devez vous connecter ou vous enregistrer pour écrire des commentaires | envoyer par email ]

Sujet: 
j'oubliait
Auteur: 
cote
Date: 
Mar, 28/07/2009 - 18:10

j'ai mis le path de postgres et de ruby dans les variables d'environnement biensur

merci.


[ Vous devez vous connecter ou vous enregistrer pour écrire des commentaires | envoyer par email ]

Nouveaux liens

Qui est en ligne
Il y a actuellement 1 utilisateur et 32 invités en ligne.

Membres en ligne :

  • fgi

railsfrance.org - communauté francophone des utilisateurs de Ruby on Rails
[ Propulsé par Drupal ]