Unable to Install Ruby Java Bridge

I have tried installing RJB but I keep getting this error :

I have tried installing RJB but I keep getting this error :

--

C:\ruby\letter4sure>gem install rjb
Building native extensions. This could take a while...
ERROR: Error installing rjb:
        ERROR: Failed to build gem native extension.

c:/ruby/bin/ruby.exe extconf.rb install rjb
checking for jni.h... no
*** 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
        --srcdir=.
        --curdir
        --ruby=c:/ruby/bin/ruby

Gem files will remain installed in
c:/ruby/lib/ruby/gems/1.8/gems/rjb-1.1.3 for inspection.
Results logged to
c:/ruby/lib/ruby/gems/1.8/gems/rjb-1.1.3/ext/gem_make.out

--

There is an mkmf.log file under
C:\ruby\lib\ruby\gems\1.8\gems\rjb-1.1.3\ext that says :

have_header: checking for jni.h... -------------------- no

"cl -nologo -E -I. -Ic:/ruby/lib/ruby/1.8/i386-mswin32 -I. -IC:\Program
Files\Java\jdk1.6.0_06\include -IC:\Program
Files\Java\jdk1.6.0_06\include\win32 -MD -Zi -O2b2xg- -G6 -IC:\Program
Files\Java\jdk1.6.0_06\include -IC:\Program
Files\Java\jdk1.6.0_06\include\win32 /W3 conftest.c -P"
checked program was:
/* begin */
1: #include <jni.h>
/* end */

--------------------

Problem is JAVA_HOME is installed and this is what it says :
C:\ruby\letter4sure>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_06

When I walk through extraconf.rb I see that it can see jni.h so what is
wrong here?

Craig White wrote:

checking for jni.h... no
        --with-opt-lib
c:/ruby/lib/ruby/gems/1.8/gems/rjb-1.1.3/ext/gem_make.out
Files\Java\jdk1.6.0_06\include -IC:\Program
Problem is JAVA_HOME is installed and this is what it says :
C:\ruby\letter4sure>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_06

When I walk through extraconf.rb I see that it can see jni.h so what is
wrong here?

----
do you have administrator permissions?

sounds like you can find the error here...

c:/ruby/lib/ruby/gems/1.8/gems/rjb-1.1.3/ext/gem_make.out

Craig

I do have admin permissions this is what I found in gem_make.out ;

c:/ruby/bin/ruby.exe extconf.rb install rjb-1.1.3.gem
checking for jni.h... no
*** 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
  --srcdir=.
  --curdir
  --ruby=c:/ruby/bin/ruby

Craig White wrote:
>> checking for jni.h... no
>> --with-opt-lib
>> c:/ruby/lib/ruby/gems/1.8/gems/rjb-1.1.3/ext/gem_make.out
>> Files\Java\jdk1.6.0_06\include -IC:\Program
>> Problem is JAVA_HOME is installed and this is what it says :
>> C:\ruby\letter4sure>echo %JAVA_HOME%
>> C:\Program Files\Java\jdk1.6.0_06
>>
>> When I walk through extraconf.rb I see that it can see jni.h so what is
>> wrong here?
> ----
> do you have administrator permissions?
>
> sounds like you can find the error here...
>
> c:/ruby/lib/ruby/gems/1.8/gems/rjb-1.1.3/ext/gem_make.out
>
> Craig

I do have admin permissions this is what I found in gem_make.out ;

c:/ruby/bin/ruby.exe extconf.rb install rjb-1.1.3.gem
checking for jni.h... no
*** 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
  --srcdir=.
  --curdir
  --ruby=c:/ruby/bin/ruby

--

Also I stepped through extraconf.rb by renaming it and putting put
statements in it and it can access the jni.h file in the jdk but
apparently its failing jni.h check here...

Yes it is a good installation.
I also installed jdk 1.5 and jni.h is indeed located there.

Craig White wrote:

Yes it is a good installation.
I also installed jdk 1.5 and jni.h is indeed located there.

Craig White wrote:
>> >> C:\Program Files\Java\jdk1.6.0_06
>> > Craig
>>
>> --ruby=c:/ruby/bin/ruby
>>
>> --
>>
>> Also I stepped through extraconf.rb by renaming it and putting put
>> statements in it and it can access the jni.h file in the jdk but
>> apparently its failing jni.h check here...
> ----
> jni.h should be located in
> C:\Program Files\Java\jdk1.6.0_06\include
>
> Is your java installation good?

This might be useful...

http://arton.no-ip.info/collabo/backyard/?HowToBuildRjb

Craig

That is precisely what I have been using along with the readme file in
rjb.

:frowning:

Craig White wrote:

BTW I figured out how to install this gem ; this opens a whole new
world (hopefully!)

I will write up the issues I encountered and post them on some blog to
help out the others.

Ather Shiraz wrote:

BTW I figured out how to install this gem ; this opens a whole new
world (hopefully!)

That's what I thought until I got pissed off with setting paths and crap
like that on different machines.