Hello! I’ve been developing SketchUp extensions using Ruby since 2006 but just joined this forum. I’m using Ruby Encoder for the first time in a project but have ran into an issue where an error is getting triggered when the Ruby Encoder loader is loading one of my encoded files.
Error Loading File /Users/trevorbone/Library/Application Support/SketchUp 2023/SketchUp/Plugins/DM_ProfileBuilder4/PBAPI/fence.rb
Error: #<SyntaxError: /Users/trevorbone/Library/Application Support/SketchUp 2023/SketchUp/Plugins/DM_ProfileBuilder4/PBAPI/fence.rb: get_local_var_idx: -1
I think the code that raises this error is found in compile.c:
get_dyna_var_idx_at_raw(const rb_iseq_t *iseq, ID id)
{
unsigned int i;
for (i = 0; i < ISEQ_BODY(iseq)->local_table_size; i++) {
if (ISEQ_BODY(iseq)->local_table[i] == id) {
return (int)i;
}
}
return -1;
}
static int
get_local_var_idx(const rb_iseq_t *iseq, ID id)
{
int idx = get_dyna_var_idx_at_raw(ISEQ_BODY(iseq)->local_iseq, id);
if (idx < 0) {
COMPILE_ERROR(iseq, ISEQ_LAST_LINE(iseq),
"get_local_var_idx: %d", idx);
}
return idx;
}
It looks like the function get_dyna_var_idx_at_raw is returning -1.
Any ideas what would cause that? I have contacted the Ruby Encoder support team as well but because the error seems to be raised within the core Ruby code, I thought I’d make a post here as well.
Thanks!