Hello all,

I'm trying to create a very simple JRuby extension. I followed the tutorial
at
https://blog.jcoglan.com/2012/08/02/your-first-ruby-native-extension-java/
and I have created a very initial version and it is available at
https://github.com/cdwijayarathna/GemTest.

After compiling, building and installing, when I tried to run it using irb,
I'm getting following error.

jruby-1.7.19 :001 > require 'fibs'
NameError: undefined local variable or method `fibs' for Fibs:Module
from /home/chamila/GSoC/2015/fib/fibs/lib/fibs.rb:7:in `Fibs'
from /home/chamila/GSoC/2015/fib/fibs/lib/fibs.rb:3:in `(root)'
from org/jruby/RubyKernel.java:1071:in `require'
from
/usr/share/rvm/rubies/jruby-1.7.19/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in
`(root)'
from
/usr/share/rvm/rubies/jruby-1.7.19/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54:in
`require'
from org/jruby/RubyKernel.java:1071:in `require'
from
/home/chamila/.rvm/gems/jruby-1.7.19/gems/fibs-0.4.0-java/lib/fibs.rb:1:in
`(root)'
from
/usr/share/rvm/rubies/jruby-1.7.19/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1:in
`(root)'
from org/jruby/RubyKernel.java:1107:in `eval'
from
/usr/share/rvm/rubies/jruby-1.7.19/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:128:in
`require'
from (irb):1:in `evaluate'
from org/jruby/RubyKernel.java:1507:in `loop'
from org/jruby/RubyKernel.java:1270:in `catch'
from org/jruby/RubyKernel.java:1270:in `catch'
from /usr/share/rvm/rubies/jruby-1.7.19/bin/irb:13:in `(root)'

I have fibs.rb and fibs.jar files in lib directory after building the gem.
Herewith I have attached the fibs.jar file as well.

It seems like the issue is that fibs.rb file is not reffering to the jar
file properly.

Can someone guide me on understanding what is the issue here and how to
solve this?

Thank You!

-- 
*Chamila Dilshan Wijayarathna,*
SMIEEE, SMIESL,
Undergraduate,
Department of Computer Science and Engineering,
University of Moratuwa.

Attachment: fibs.jar
Description: application/java-archive

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to