Please include full output and complete error messages you're getting.
Your assumption of the problem is not helping us figure out what is
going on in your environment.
Also, include the more information as possible about your system,
version of Ruby, location of the files, etc.
The more information, the better we can help you.
···
On Dec 23, 8:28 pm, Chananya Freiman <thebluedrag...@gmail.com> wrote:
I can't seem to get even the simplest C extension taken fromhttp://www.rubyinside.com/how-to-create-a-ruby-extension-in-c-in-unde...
to work.
The interpreter acknowledges that MyTest exists and knows it's a module,
but it doesn't recognize the method(s) I define.
Ok....not sure if this is related to Ruby exactly, but I found something
extraordinarily odd!
If I use Ruby to generate a Makefile for me and use "make", it
completely ignores every "near" and "far" in the C file.
They simply don't exist as far as GCC cares for...
That tutorial is very old and out of date for 1.9.2. If you want to
call the method as you did in the above irb session, then you should
define the method with rb_define_module_function instead of
rb_define_method.
Please read the README.EXT which comes with the ruby source for a good
overview of latest API.
HTH,
Ammar
···
On Fri, Dec 24, 2010 at 12:23 PM, Chananya Freiman <thebluedragont@gmail.com> wrote:
Windows 7, Ruby 1.9.2.
The code is just in an arbitrary folder, so I have to include it with
"require './file'" because otherwise Ruby can't find it.
The error just says there's no such method in my module, here's a
snapshot of irb: