2011-12-17 6 views
2
212-178-13-214:~ igorfedoronchuk$ gem install pg Building native extensions. This could take a while... 
/Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/ext/builder.rb:48: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 
ERROR: Error installing pg: 
    ERROR: Failed to build gem native extension. 

     /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb 
checking for pg_config... yes 
Using config values from /usr/bin/pg_config 
checking for libpq-fe.h... *** 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=/Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/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 
/Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' 
    from /Users/igorfedoronchuk/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:852:in `find_header' 
    from extconf.rb:36:in `<main>' 


Gem files will remain installed in /Users/igorfedoronchuk/.rvm/gems/[email protected]/gems/pg-0.12.0 for inspection. 
Results logged to /Users/igorfedoronchuk/.rvm/gems/[email protected]/gems/pg-0.12.0/ext/gem_make.out 

Postgres a été téléchargé et installé à partir http://www.postgresql.org/download/macosx/ (version 9.1)gem pg installer sur Mac OS Lion avec RVM

Je tentais d'installer postgres Brew - aucun résultat.

Comment résoudre ce problème? Merci

+0

Le système ruby1.9.1-dev est-il installé? Je ne sais pas comment l'installer sur OSX, mais cela m'a permis de résoudre ce problème sous Linux (je l'ai eu via le gestionnaire de paquets). – Linuxios

+0

RVM est maintenant utilisé rubis RVM ruby-1.8.7-P334 [i686] => rubis-1.9.2-p180 [x86_64] – Fivell

+0

Je vais avoir encore une erreur, même après avoir utilisé homebrew installer postgresql. C'est la même erreur. la version de ruby ​​est ruby-1.9.2-p290 –

Répondre

3

Le message d'erreur ("Vous devez d'abord installer les outils de développement.") Dit tout. Installez d'abord Xcode, puis essayez d'installer le pg gem.

De même, vous n'avez pas besoin d'installer un PostgreSQL tiers sur Lion, car il est déjà inclus.

+0

xcode est installé – Fivell

+0

l'installation de la dernière version de xcode à partir d'appstore a corrigé ceci. – Fivell

+1

Je viens d'installer la version 4.2.1 et je reçois toujours l'erreur. Des idées? – Scott

2

Je faisais la même question et voici où j'ai trouvé mon resolution

Hope this helps!

Questions connexes