[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Newby question: use Rubyinline error

Ak 756

3/28/2007 2:31:00 AM

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.

--
Posted via http://www.ruby-....

1 Answer

Ryan Davis

3/28/2007 2:59:00 AM

0


On Mar 27, 2007, at 19:31 , Ak 756 wrote:

> require 'inline'
> # ...
> from inline.rb:2

Don't call your file inline.rb if you're going to require 'inline'.