librelist archives

« back to archive

JRuby Support

JRuby Support

From:
Mark Peterson
Date:
2012-03-02 @ 01:22
I have unicorn and kgio working on Ruby on Rails app, but cannot install
kgio on JRuby environment.

It installs fine with regular Ruby 1.9.2, but on JRuby 1.6.7, running ruby
1.9.2 it gives the errors below.

My environment: jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java
HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]

Installing kgio (2.7.2) with native extensions
Gem::Installer::
ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/bin/jruby extconf.rb

WARNING: JRuby does not support native extensions or the `mkmf' library
very well.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
checking for CLOCK_MONOTONIC in time.h... no
checking for CLOCK_MONOTONIC() in time.h... no
checking for clockid_t in time.h... no
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... checking for getaddrinfo() in
sys/types.h,sys/socket.h,netdb.h... yes
checking for getnameinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for struct sockaddr_storage in sys/types.h,sys/socket.h... yes
checking for accept4() in sys/socket.h... no
checking for sys/select.h... yes
checking for ruby/io.h... no
checking for OpenFile in ruby.h,rubyio.h... yes
checking for OpenFile.f in ruby.h,rubyio.h... yes
checking for OpenFile.f2 in ruby.h,rubyio.h... no
checking for OpenFile.mode in ruby.h,rubyio.h... yes
checking for OpenFile.path in ruby.h,rubyio.h... no
checking for rb_fdopen()... no
checking for struct RFile in ruby.h,rubyio.h... no
checking for struct RObject... no
checking size of int... ./conftest: ./conftest: cannot execute binary file
TypeError: can't convert nil into Integer
Integer at org/jruby/RubyKernel.java:433
try_constant at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:502
popen at org/jruby/RubyIO.java:3741
xpopen at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:323
open at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:260
xpopen at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:316
try_constant at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:501
check_sizeof at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:975
checking_for at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:652
postpone at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:286
open at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:260
postpone at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:286
open at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:260
postpone at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:282
checking_for at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:651
check_sizeof at
/Users/MYUSERNAME/.rvm/rubies/jruby-1.6.7/lib/ruby/site_ruby/shared/mkmf.rb:974
(root) at extconf.rb:42
*** 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/MYUSERNAME/.rvm/rubies/jruby-1.6.7/bin/jruby
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib

Gem files will remain installed in
/Users/MYUSERNAME/.rvm/gems/jruby-1.6.7@myproject/gems/kgio-2.7.2 for
inspection.
Results logged to /Users/MYUSERNAME/.rvm/gems/jruby-1.6.7@myproject
/gems/kgio-2.7.2/ext/kgio/gem_make.out
An error occured while installing kgio (2.7.2), and Bundler cannot continue.
Make sure that gem install kgio -v '2.7.2' succeeds before bundling.

Re: [kgio] JRuby Support

From:
Eric Wong
Date:
2012-03-02 @ 01:37
Mark Peterson <playerspeak@gmail.com> wrote:
> I have unicorn and kgio working on Ruby on Rails app, but cannot install
> kgio on JRuby environment.

kgio is only for Rubies that support C extensions.  If you run JRuby
or unsupported systems, make kgio an optional dependency.

kgio exists to expose (and hopefully fix) performance issues in MRI:
  https://bugs.ruby-lang.org/issues/5138

Once MRI developers accept an API do non-blocking I/O without the
current overhead, kgio will be obsolete.

Re: [kgio] JRuby Support

From:
Mark Peterson
Date:
2012-04-02 @ 00:50
Thank you. I was barking up the wrong tree.

On Thu, Mar 1, 2012 at 8:37 PM, Eric Wong <normalperson@yhbt.net> wrote:

> Mark Peterson <playerspeak@gmail.com> wrote:
> > I have unicorn and kgio working on Ruby on Rails app, but cannot install
> > kgio on JRuby environment.
>
> kgio is only for Rubies that support C extensions.  If you run JRuby
> or unsupported systems, make kgio an optional dependency.
>
> kgio exists to expose (and hopefully fix) performance issues in MRI:
>  https://bugs.ruby-lang.org/issues/5138
>
> Once MRI developers accept an API do non-blocking I/O without the
> current overhead, kgio will be obsolete.
>