Problem in rbx

Hi, all,

I’m new to the list, as I’m interested in getting involved in the
IronRuby
project (combine my two loves: ruby and C#). I followed John’s video on
downloading and installing it, and I noticed one major difference: there
is
no release folder. Instead, I find rbx.exe in the
c:\svn\trunk\build\debug.
When I cd into it and run it, the console comes up. I can do the first
step
a = [1,2,3]

but, when I try to do anything with a, it throws a

System.MissingMethodException: undefined local variable or method ‘a’
for
main:Ruby.Builtins.RubyClass

Any thoughts?

Also, here is a jinq video capture of the thing:

-Corey

I believe this is due to a bug (for now) in rbx.exe regarding local
variables. I think the current advice is to make the variable a global
like so:

@a = [1, 2, 3]

Hope this helps

Terence

Thanks, Terrence, that worked!

-Corey

Terence L. wrote:

I believe this is due to a bug (for now) in rbx.exe regarding local
variables. I think the current advice is to make the variable a global
like so:

@a = [1, 2, 3]

@ is for instance variables. $ is for globals. The above code assigns
[1,2,3] to the instance variable @a on the toplevel object.

  • Charlie

Aargh, apologies - you’re right of course :P.

Thanks for the clarification.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs