Proporcionar algunos antecedentes – simplemente he descargado un repositorio Git de GitHub, para un amigo de un app y estoy intentando lanzar desde mi Mac (‘rails s’). Sin embargo, estoy de ser golpeado con el siguiente error //ver abajo //cuando se ejecuta ‘bundle install’. Parece como si el ‘pg’ (postgreSQL) gema es tener algún tipo de oscuro de error de instalación. Cualquier ayuda se agradece!

He probado este comando fue en vano:

$gem install pg-con-pg-config= /usr/bin/pg_config/

Y aquí está el registro de errores:

Installing pg (0.15.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for PQsetSingleRowMode()... no
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... no
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile
make
compiling gvl_wrappers.c
compiling pg.c
pg.c: In function Init_pg_ext’:
pg.c:384: error: PQPING_OK undeclared (first use in this function)
pg.c:384: error: (Each undeclared identifier is reported only once
pg.c:384: error: for each function it appears in.)
pg.c:386: error: PQPING_REJECT undeclared (first use in this function)
pg.c:388: error: PQPING_NO_RESPONSE undeclared (first use in this function)
pg.c:390: error: PQPING_NO_ATTEMPT undeclared (first use in this function)
make: *** [pg.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.15.0 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p194/gems/pg-0.15.0/ext/gem_make.out
An error occured while installing pg (0.15.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.0'` succeeds before bundling.

GemFile

source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails',   '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'devise'
gem 'rails-backbone'
gem 'nokogiri'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
  • cuál es su entorno?
  • He intentado @garbagecollection ‘s método y no ha habido suerte :(. He actualizado el post inicial con el GemFile, así que usted puede ver el medio ambiente.
  • a ver si esto ayuda & por favor upvote si ayuda 😉 stackoverflow.com/questions/12273815/…
InformationsquelleAutor | 2013-04-04

3 Comentarios

  1. 1

    En sistemas Debian tienes que instalar libpq-dev paquete con el fin de utilizar postgres en un servidor distante con ‘pg’ joya.

  2. 0

    Instalar

    http://postgresapp.com/

    luego

    PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

    luego

    bundle install

Dejar respuesta

Please enter your comment!
Please enter your name here