Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Mette Jørgensen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-12 10:54
rsruby-0.5.1 is working perfectly.
Thanks.

But another funny thing is that this morning rsruby-0.5.1.1 was complaining about RARRAY_LEN instead of RSTRING_PTR so it seems that ruby finally realized that RSTRING_PTR was defined in ruby.h So it seems like Johnny was on the right track :-)

By: Johnny Nguyen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-11 13:30
No type errors that I can see. Hopefully the previous version of the gem works for you.

By: Mette Jørgensen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-11 09:04
Thanks a lot.
I will try to use rsruby 0.5.1
Here is the relevant lines of ruby.h in case you can find a typing error or something

#define ELTS_SHARED FL_USER2

struct RString {
struct RBasic basic;
long len;
char *ptr;
union {
long capa;
VALUE shared;
} aux;
};

#define RSTRING_PTR(s) (RSTRING(s)->ptr)
#define RSTRING_LEN(s) (RSTRING(s)->len)

struct RArray {
struct RBasic basic;
long len;
union {
long capa;
VALUE shared;
} aux;
VALUE *ptr;
};

By: Alex Gutteridge
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 16:47
Thanks for your help with this Johnny.

I'll just comment that regressing to version 0.5.1 (gem or tarball) should fix this problem. There aren't any real new features you would be missing out on, since the latest version just has the changes required to compile with ruby 1.9 (and look to have to broken 1.8.4).

By: Johnny Nguyen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 16:28
Could you paste lines 325 to lines 355 of ruby.h?

By: Mette Jørgensen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 16:19
I haven't used pastie.org before so I'm not sure how to use it. But I tried to paste in my code. It is the one starting with:
/**********************************************************************

ruby.h -
The test script is in the end after the "##" I added line 340+341 to ruby.h

Here is the error I get:
> test_rsruby.rb
/usr/bin/ruby: symbol lookup error: /usr/lib/ruby/gems/1.8/gems/rsruby-0.5.1.1/lib/rsruby_c.so: undefined symbol: RSTRING_PTR

And my ruby version:
> ruby -v
ruby 1.8.4 (2005-12-24) [x86_64-linux]

By: Johnny Nguyen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 14:28
If you are getting the exact same error, then RSTRING_PTR is still not being defined correctly. Can you attach your code somewhere? Perhaps pastie.org or something.

By: Mette Jørgensen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 14:17
Yes I'm editing as root. The reason I'm using 1.8.4 is that is the newest ruby version in Ubuntu package system.
/Mette

By: Johnny Nguyen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 13:10
Hmm, as long as you saved it correctly, you should be okay. Are you editing as root?

You might want to try upgrading to Ruby 1.8.6 if it continues to give you the error.

By: Mette Jørgensen
RE: undefined symbol: RSTRING_PTR with ruby 1 [ reply ]  
2009-03-10 11:56
Hey
Should I do anything after I changed the ruby.h file(/usr/lib/ruby/1.8/x86_64-linux/ruby.h)?
My test script still gives the same error.
/Mette

By: Johnny Nguyen
RE: undefined symbol: RSTRING_PTR with ruby 1.8.4 [ reply ]  
2009-03-09 16:05
Hi Mette,

Try adding these lines to the ruby.h (/usr/lib/ruby/1.8/i386-linux/ruby.h) file:

#define RSTRING_PTR(s) (RSTRING(s)->ptr)
#define RSTRING_LEN(s) (RSTRING(s)->len)

Let me know if that works for you.

-Johnny

By: Mette Jørgensen
undefined symbol: RSTRING_PTR with ruby 1.8.4 [ reply ]  
2009-03-09 15:54
Hey
I'm using ruby 1.8.4 and gets the following error when I'm trying to initialize the RSRuby object:

irb(main):003:0> r=RSRuby.instance
irb1.8: symbol lookup error: /usr/lib/ruby/gems/1.8/gems/rsruby-0.5.1.1/lib/rsruby_c.so: undefined symbol: RSTRING_PTR

Any ideas on how to fix the problem?
Best
Mette