Newby question: use Rubyinline error

A

Ak 756

I want to use rubyinline to write a simple code with inline c functions.

Here is my code:

require 'rubygems'
require 'inline'

class TestC
inline do |builder|
builder.c "
static void hello(int n) {
printf(\"Hello %d\\n\", n);
}
"
end
end

k = TestC.new
k.hello(5)

when I run this code, I get error as:

/inline.rb:5: undefined method `inline' for TestC:Class (NoMethodError)
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
m_original_require'
from
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
from inline.rb:2

Would anybody help to find what's the err?

I use 'gem install rubyinline' to install rubyinline and get results as
'Successfully installed RubyInline-3.6.2', so I think the rubyinline
should be installed without err.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

RubyInline 17
RubyInline and Digest::Base error 0
Graticule error? 0
Sequel 2.1 and Windows 2
Problem while using scrubyt 0
Help : Error in scrubyt 0
Re : RubyInline 3.6.3 Released 0
require error in gems 4

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top