Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg 0.12.1 fails to install with ruby 1.8.7 in Ubuntu 11.10 #97

Closed
ged opened this issue Jan 3, 2012 · 5 comments
Closed

pg 0.12.1 fails to install with ruby 1.8.7 in Ubuntu 11.10 #97

ged opened this issue Jan 3, 2012 · 5 comments

Comments

@ged
Copy link
Owner

ged commented Jan 3, 2012

Original report by Phong Nguyen (Bitbucket: phongnh, GitHub: phongnh).


@ged
Copy link
Owner Author

ged commented Jan 3, 2012

Original comment by Anonymous.


+1, we are experiencing this issue too. Travis CI tests are failing because of this.

Error: pg currently requires the ruby/st.h header

Here is the trace from 'bundle install':

#!bash
Installing pg (0.12.1) with native extensions Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Thanks!
/home/ndbroadbent/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/installer.rb:552:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /home/ndbroadbent/.rvm/rubies/ruby-1.8.7-p352/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 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 PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for PQsetClientEncoding()... yes
checking for rb_encdb_alias()... no
checking for rb_enc_alias()... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... no
pg currently requires the ruby/st.h header
*** 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=/home/ndbroadbent/.rvm/rubies/ruby-1.8.7-p352/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
	--with-pqlib
	--without-pqlib
	--enable-static-build
	--disable-static-build


Gem files will remain installed in /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/pg-0.12.1 for inspection.
Results logged to /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/pg-0.12.1/ext/gem_make.out
	from /home/ndbroadbent/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/installer.rb:505:in `each'
	from /home/ndbroadbent/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/installer.rb:505:in `build_extensions'
	from /home/ndbroadbent/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/installer.rb:180:in `install'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/source.rb:90:in `install'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/rubygems_integration.rb:82:in `preserve_paths'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/source.rb:89:in `install'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:73:in `install_gem_from_spec'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/rubygems_integration.rb:97:in `with_build_args'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:72:in `install_gem_from_spec'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:56:in `run'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:55:in `run'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/installer.rb:12:in `install'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/cli.rb:220:in `install'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/task.rb:22:in `send'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/task.rb:22:in `run'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor.rb:263:in `dispatch'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/lib/bundler/vendor/thor/base.rb:386:in `start'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/gems/bundler-1.1.rc.7/bin/bundle:13
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/bin/bundle:19:in `load'
	from /home/ndbroadbent/.rvm/gems/ruby-1.8.7-p352/bin/bundle:19

@ged
Copy link
Owner Author

ged commented Jan 3, 2012

Original comment by Anonymous.


I have the same using REE. With ruby 1.9.2 it installs fine.

@ged
Copy link
Owner Author

ged commented Jan 3, 2012

Original comment by Anonymous.


I had the same problem. The extconf.rb file in line 64 requires st.h in /ruby:

//have_header 'ruby/st.h' or abort "pg currently requires the ruby/st.h header"//

However, I think that it must be replaced by,

// //have_header 'st.h' or abort "pg currently requires the ruby/st.h header"////

I have made a ruby directory in mkdir /usr/lib/ruby/1.8/x86_64-linux
mkdir /usr/lib/ruby/1.8/x86_64-linux/ruby and I have copied the st.h file to the new directory /usr/lib/ruby/1.8/x86_64-linux/ruby/
then I run sudo gem install pg and pg was successful installed.

//Building native extensions. This could take a while...//

//Successfully installed pg-0.12.1//

//1 gem installed//

//Installing ri documentation for pg-0.12.1...//

//Installing RDoc documentation for pg-0.12.1...//

@ged
Copy link
Owner Author

ged commented Jan 3, 2012

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Issue #98 was marked as a duplicate of this issue.

@ged
Copy link
Owner Author

ged commented Jan 3, 2012

Original comment by Michael Granger (Bitbucket: ged, GitHub: ged).


Fixed by [[https://bitbucket.org/ged/ruby-pg/changeset/0cf272cb383f|a patch]] from @larskanis. Thanks again Lars!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant