IronRuby is an implementation of Ruby on the .NET platform
It isn’t integrated in visual studio yet but you can use visual studio
to
debug ironruby code.
There is no intellisense for ironruby and you will struggle to find any
IDE
that has some kind of properly working autocomplete like intellisense
for
the ruby language. You can use the console and ask the type for its
methods
if you want to use intellisense primarily for discovery.
For ruby objects
get all methods
System::String.methods
get instance methods
System::String.instance_methods
get class (static) methods
System::String.methods - System::String.instance_methods
To get started extract the downloaded zip file to a folder on your drive
and
add that folder\bin to your PATH environment variable
for example C:\ironruby\bin if you extracted to C:\ironruby
There is no intellisense for ironruby and you will struggle to find any
IDE that has some kind of properly working autocomplete like intellisense
for the ruby language.
Our IntelliSense is currently only for standard Ruby, however.
While we do have a Visual Studio IDE that supports IronRuby, we released
that a long time ago to support in-development releases of IR and this
is far more basic than our commercial VS IDE for standard Ruby. We won’t
be doing any more work on our IronRuby IDE until after the launch of
IronRuby 1.0.
Patience, this is what mailing lists are for More thorough
documentation is on its way as it gets closer to 1.0.
I seem to be missing some very basic steps to getting started with Iron Ruby.
Documentation keeps talking about something called Merlin?
Opening VS.NET and looking at opening a project shows no templates for IR.
I would have thought that would be the first step.
Can someone break this down for me?
Those instructions are geared towards contributors to IronRuby debugging
Ruby code, as it is on GitHub. “Merlin” is a directory in the IronRuby
source tree. However, replacing “c:\vsl\Merlin\Main\Bin\Debug” with your
path to “ir.exe” (if you have the latest path, it’s
“wherever/you/unzipped/it/bin/ir.exe”) is good enough for most of that
documentation.
Visual Studio does not have any IronRuby project-system support when you
install it. However, being able to debug a IronRuby script is entirely
dependent on IronRuby providing the correct information to the Visual
Studio debugger. Though the support isn’t great, you can place
breakpoints in a Ruby script and step through it in VS:
Place a “gets” call as the first line of the Ruby script.
Run "ir.exe -D yourrubyscript.rb
Launch VS, and open yourrubyscript.rb.
Place a breakpoint somewhere in your code.
Launch VS, and go-to Tools > Attach to Process
Select the ir.exe process.
Switch back to your running Ruby script, and press “Enter”. Now the
script will run and the debugger will break at your breakpoint in Ruby
code.
Support for IronRuby debugging in VS has plenty of room to get better,
especially if we had a project-system for Ruby to remove the need for
starting the process yourself and attaching to it. We could also be
better about emitting debug information so stepping into
blocks/ifs/whiles/etc where easier/possible. Also, if IronRuby supported
ruby-debug (which it does not today), then IronRuby could be debugged by
any existing Ruby IDE.
Today I use this very simple Ruby script to debug my IronRuby code: repl.rb · GitHub. It just gives you a little repl loop
wherever you ask for it; like “ruby-debug” but without the ability to
step.
Let me know if you have any more questions about debugging in Visual
Studio, and keep an eye on this list for more information about Ruby
debugging as we get closer to 1.0.
~Jimmy
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.