IridiumSE - Using Ruby Gems

  • Julio Vilela

    Julio Vilela - 2013-02-09


    Note this questions is NOT about Iridium UI. Its about Iridium SE

    I've been playing around with IridiumSE that comes in USARtools as part of the UDK package.
    Its a fantastic platform to run Ruby scripts in order to control Robots in USARSim.

    Now for those familiar with Ruby, libraries are known as gems. I have downloaded and correctly installed some Ruby gems and I would like to use these in my Ruby code that will run for USARsim.

    ISSUE 1
    For some reason, the Iridium SE is not able to load any files outside the IrdiumSE root folder. That is, you cannot use any gems installed in your machine! I have tested the gems by running the Ruby code through Command Prompt in Windows 7 and it works just fine. However, for some reason IridiumSE is not able to find this gems. Of course, if you want to reference another file found in the IridiumSE it will work, but referencing any other file outside IridiumSE will not.

    The actual error message I get is: "Load error: No such file to load -- [gem_name]"
    Where gem_name is the name of the gem (library) that I want to use in my Ruby code for IridiumSE.

    ISSUE 2
    Another issue I encountered is that whenever i try to edit some of the files in the source code (like usarcore.rb), IridiumSE will never catch any changes. It will run as it no changes have ever happened. So if I include new Ruby classes/methods, it will not recognize these additions. Does this mean I have to import all the Java code as a project to Eclipse, re-generate IridiumSE engine such that it recognizes the new classes, and perhaps the new gems I want to use, as explained in Issue1?

    Any help is greatly appreciated. IridiumSE does not have a lot of documentation but its a superb interface. i already got it workin with P3AT robots and the last thing I need to is use other gems to visually display results.

  • Julio Vilela

    Julio Vilela - 2013-02-11

    I partially solved Issue 1. IridiumSE will not look at the gems installed in your PC, but at the gems found in the jrubyscript.jar file found in the IridiumSE folder.

    ISSUE 1 - Solution
    In order to add your Ruby gems to IridiumSE, you need to edit the jrubyscript.jar file. Open it using WinRAR or WinZip, and go to:


    In this subfolder, place any .rb files of your gem, or dump in the folder (make sure you remember the name). Any time you wish to include a gem in your Ruby Script, say 'my_gem', just write the following at the top of your Ruby main script:

    require 'my_gem'

    Any gem that is found in the subfolders will have to include the path extensions, for example:

    require 'rdoc/rdoc'


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks