Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Extending Gosu / Help with Jruby
- - By onnoowl Date 2013-01-23 13:12 Edited 2013-01-23 13:54
Hello, I'm trying to get gosu working on jruby. It does not seem to be working.
This is what happens:

I run the command: jgem install gosu

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

        c:/jruby-1.7.2/bin/jruby.exe extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

c:/jruby-1.7.2/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and
deprecated Config.
Errno::ENOENT: No such file or directory - uname
       at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:24
      
at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:49
  (root) at extconf.rb:66
*** 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=c:/jruby-1.7.2/bin/jruby

Gem files will remain installed in c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu
-0.7.45 for inspection.
Results logged to c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu-0.7.45/linux/gem
_make.out
Parent - - By jlnr (dev) Date 2013-01-23 15:03
The only Gosu gem that works on Windows is the precompiled gem for Ruby 1.8/1.9 (MRI). The gem you are trying to install is the source code gem, which does not contain source files for Windows (only Linux and OS X).

Further, it seems that your installation of JRuby cannot handle source code gems at all. Can you please try installing other binary gems like texplay or chipmunk? If these indeed work, I can build a gem for you that may or may not work with JRuby.
Parent - - By onnoowl Date 2013-01-24 00:38
Rather unfortunately, i got quite a similar error when trying to install texplay...
Is there something wrong with my jruby installation?
I got the windows installer, ran it, and added it to my path.
The only odd thing is i followed some advice that one of the errors gave me...
It told me to run something like this:
set JRUBY_OPTS=-Xcext.enabled=true

Anyways, this is what i got from installing texplay:
jgem install texplay
Building native extensions.  This could take a while...
ERROR:  Error installing texplay:
        ERROR: Failed to build gem native extension.

        c:/jruby-1.7.2/bin/jruby.exe extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux

c:/jruby-1.7.2/lib/ruby/shared/mkmf.rb:14: Use RbConfig instead of obsolete and
deprecated Config.
Errno::ENOENT: No such file or directory - uname
       at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:24
      
at file:/C:/jruby-1.7.2/lib/jruby.jar!/jruby/kernel/jruby/process_manag
er.rb:49
  (root) at extconf.rb:66
*** 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=c:/jruby-1.7.2/bin/jruby

Gem files will remain installed in c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu
-0.7.45 for inspection.
Results logged to c:/jruby-1.7.2/lib/ruby/gems/shared/gems/gosu-0.7.45/linux/gem
_make.out
Parent - By jlnr (dev) Date 2013-01-24 07:08
I know next to nothing about either JRuby or building C extensions on Windows :) So this is probably more of a question for a JRuby board... and once simple C extensions work, I can help with getting Gosu to work (or at least give it a try).
Parent - - By pete_mw Date 2013-04-04 14:25
Sorry for posting on an old thread, but I think this is probably the best place to put this since it's still on the first page.

As of JRuby 1.7, native extension support is disabled by default, and it will be removed in future. So getting Gosu running on JRuby is not going to happen this way.

SWIG can generate bindings to Java, however, so in theory, it may be possible to create a Java version of Gosu and then access it using JRuby. I don't know whether or not anyone has tried this or how far they got.
Parent - By jlnr (dev) Date 2013-04-04 14:54
Ouch. That's bad news!

The SWIG file is not entirely language-neutral: The RubyGosu.swg file contains some Ruby C API code that throws around VALUEs. After that, I patch the resulting cxx file to work around a really old bug in SWIG. And THEN I still patch lots of stuff in pure Ruby :)

If SWIG's Java output is of the same quality, then that would be theoretically possible, but it might not be much more fun than hand-writing a wrapper around Gosu...
Up Topic Gosu / Extending Gosu / Help with Jruby

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill