[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Embedding Ruby 1.9

Kambiz Bizi

8/7/2008 7:19:00 PM

from main.c I have learned to load and run a single script but how can I
load and run several scripts? When I call ruby_run_node for a second
time I get a "Segmentation fault" error.

This is OK:
char * f[] = {"","script.rb"};
void* node = ruby_options(2,f);
ruby_run_node(node);

but obviously I can not load and run the second script the same way, the
code

char * f2[] = {"","script2.rb"};
void* node2 = ruby_options(2,f2);
ruby_run_node(node2);

generates the following output:

*********************************
: warning: already initialized constant Enable
: [BUG] Segmentation fault
ruby 1.9.0 (2007-12-25 revision 14709) [x86_64-linux]

-- control frame ----------
c:0002 p:-845116 s:0004 b:0004 l:000003 d:000003 TOP
c:0001 p:0000 s:0002 b:0002 l:000001 d:000001 TOP <dummy
toplevel>:103
---------------------------
-- backtrace of native function call (Use addr2line) --
0x7f0d703a7b52
0x7f0d702c513b
0x7f0d702c5242
0x7f0d70351ff9
0x7f0d6f7b7100
0x7f0d6fae2c70
-------------------------------------------------------

Run failed. Exit value 134.
*********************************

I would also like to know how to run different scripts independently (in
separate scopes).
--
Posted via http://www.ruby-....