Forum: Ruby Newby question: use Rubyinline error

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6d59f83e787fddec1b6f4aebb86b1613?d=identicon&s=25 Ak 756 (ak756)
on 2007-03-28 04:31
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);

k =

when I run this code, I get error as:

./inline.rb:5: undefined method `inline' for TestC:Class (NoMethodError)
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
        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.
509e15b158eaac5ab3a5332a3f89d4a7?d=identicon&s=25 Peter Cooper (Guest)
on 2007-03-28 04:54
(Received via mailing list)
On 3/28/07, Ak 756 <> wrote:
>         from inline.rb:2
> Would anybody help to find what's the err?

You didn't call your own source file 'inline.rb' by any chance? That
cause this error. Use a different filename.

Peter Cooper
5a837592409354297424994e8d62f722?d=identicon&s=25 Ryan Davis (Guest)
on 2007-03-28 04:59
(Received via mailing list)
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'.
This topic is locked and can not be replied to.