JRuby does not support native extensions or the `mkmf' library

Dear all,

I have

  jruby-1.5.6 installed on my CentOS.

[root@malhomaidan-pc ~]# gem environment
RubyGems Environment:

  • RUBYGEMS VERSION: 1.5.0
  • RUBY VERSION: 1.8.7 (2010-12-03 patchlevel 249) [java]
  • INSTALLATION DIRECTORY:
    /usr/src/ivr_setup/jruby-1.5.6/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: /usr/src/ivr_setup/jruby-1.5.6/bin/jruby
  • EXECUTABLE DIRECTORY: /usr/src/ivr_setup/jruby-1.5.6/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • universal-java-1.6
  • GEM PATHS:
    • /usr/src/ivr_setup/jruby-1.5.6/lib/ruby/gems/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
    • “install” => “–env-shebang”
    • “update” => “–env-shebang”
  • REMOTE SOURCES:

========================================
[root@malhomaidan-pc ~]# gem list

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (1.1.1)
activerecord-jdbcmysql-adapter (1.1.1)
activeresource (2.3.5)
activesupport (2.3.5)
adhearsion (1.0.0, 0.8.3)
columnize (0.3.1)
i18n (0.5.0)
jdbc-mysql (5.1.13)
log4r (1.1.9)
mkrf (0.2.3)
rack (1.0.1)
rails (2.3.5)
rake (0.8.7)
rspec (1.3.0)
rubigen (1.5.6)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.2 java)
rubygems-update (1.5.0)
sources (0.0.1)

====================================================

When I tried to install following I got following error.

[root@malhomaidan-pc ~]# gem install jsgoecke-restful_adhearsion
–source=http://gems.github.com/
Building native extensions. This could take a while…
ERROR: Error installing jsgoecke-restful_adhearsion:
ERROR: Failed to build gem native extension.

    /usr/src/ivr_setup/jruby-1.5.6/bin/jruby extconf.rb

WARNING: JRuby does not support native extensions or the `mkmf’ library.
Check http://kenai.com/projects/jruby/pages/Home for
alternatives.
extconf.rb:4: uninitialized constant CONFIG (NameError)

Gem files will remain installed in
/usr/src/ivr_setup/jruby-1.5.6/lib/ruby/gems/1.8/gems/json-1.1.3 for
inspection.
Results logged to
/usr/src/ivr_setup/jruby-1.5.6/lib/ruby/gems/1.8/gems/json-1.1.3/ext/json/ext/parser/gem_make.out

does anyone can help me ?

Thanks,
Ashik

What that gem appears to want to do is compile a C extension to support
the
gem. I don’t believe JRuby 1.5 or earlier has any support for
C-extensions
(since it’s Java), but you could just try to install the
restful_adhearsion
gem instead of the one you were trying:

PS C:\mydocs> jruby -S gem install restful_adhearsion
Fetching: json-1.5.1-java.gem (104960B)
Fetching: rest-client-1.6.1.gem (55296B)
Fetching: restful_adhearsion-0.1.3.gem (5120B)
Successfully installed json-1.5.1-java
Successfully installed rest-client-1.6.1
Successfully installed restful_adhearsion-0.1.3
3 gems installed
PS C:\mydocs>

-Nick K.

does anyone can help me ?

Have you read these two posts?

http://blog.bithug.org/2010/11/rsoc

You may also want to try out the experimental C extension support by
doing something like

git clone git://github.com/jruby/jruby.git
cd jruby
ant clean jar cext

…and then try your “gem install jsgoecke-restful_adhearsion” again to
see how things work.

Jon


blog: http://jonforums.github.com/
twitter: @jonforums