checking for jni.h... no *** extconf.rb failed ***

If you are having the follow issue tryiing to install Buildr or the Ruby Java Bridge on a windows box (ruby one click installer) :

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
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/usr/tool/Ruby/bin/ruby

Try to look if the platform is correct. In my case I used the follow command:

gem install buildr --platform x86-mswin32-80

If you get the gem platforms help, you will look at the follow text:

RubyGems platforms are composed of three parts, a CPU, an OS, and a
version. These values are taken from values in rbconfig.rb. You can view
your current platform by running `gem environment`.

RubyGems matches platforms as follows:

* The CPU must match exactly, unless one of the platforms has
"universal" as the CPU.
* The OS must match exactly.
* The versions must match exactly unless one of the versions is nil.

For commands that install, uninstall and list gems, you can override what
RubyGems thinks your platform is with the --platform option. The platform
you pass must match "#{cpu}-#{os}" or "#{cpu}-#{os}-#{version}". On mswin
platforms, the version is the compiler version, not the OS version. (Ruby
compiled with VC6 uses "60" as the compiler version, VC8 uses "80".)

Example platforms:

x86-freebsd # Any FreeBSD version on an x86 CPU
universal-darwin-8 # Darwin 8 only gems that run on any CPU
x86-mswin32-80 # Windows gems compiled with VC8

When building platform gems, set the platform in the gem specification to
Gem::Platform::CURRENT. This will correctly mark the gem with your ruby's
platform.

Because one history where I'm working I installed the VC8 redistributable and then my ruby became a rock.

Of course, check if jni.h is ok in your jdk/include folder :)






0 comentarios:

Publicar un comentario