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

9.1.8.0 "gem install pg" always Failed on Centos7_x64 #4595

Closed
hezengqi opened this issue May 9, 2017 · 3 comments
Closed

9.1.8.0 "gem install pg" always Failed on Centos7_x64 #4595

hezengqi opened this issue May 9, 2017 · 3 comments
Milestone

Comments

@hezengqi
Copy link

hezengqi commented May 9, 2017

/opt/jruby-9.1.8.0/bin/gem install pg

Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.

current directory: /opt/jruby-9.1.8.0/lib/ruby/gems/shared/gems/pg-0.20.0/ext

/opt/jruby-9.1.8.0/bin/jruby -r ./siteconf20170509-12119-12tafom.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.

 try_do at /opt/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:456

try_link0 at /opt/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:541
try_link at /opt/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:556

at extconf.rb:40
*** 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=/opt/jruby-9.1.8.0/bin/jruby
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/opt/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/pg-0.20.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /opt/jruby-9.1.8.0/lib/ruby/gems/shared/gems/pg-0.20.0 for inspection.
Results logged to /opt/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/pg-0.20.0/gem_make.out

@headius
Copy link
Member

headius commented May 9, 2017

JRuby does not support C extensions written for MRI (C Ruby). However there's a working port of pg for JRuby here: https://github.com/headius/jruby-pg

I will look at turning this into a gem today, so at least you can try it easily.

@headius
Copy link
Member

headius commented May 9, 2017

I have pushed jruby-pg 0.1 to rubygems.org. It is still a work in progress but give it a try.

@headius headius closed this as completed May 9, 2017
@headius headius added this to the Non-Release milestone May 9, 2017
@mkristian
Copy link
Member

mkristian commented May 10, 2017 via email

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

No branches or pull requests

3 participants