Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

What do you use to write/compile/test Ruby programs?

I downloaded Ruby from the official site and it came with this thing called SciTE that appears able to run and compile Ruby programs, but every time I click Tools > Go, it gives me an error that reads:

>ruby Test Program.rb
ruby: No such file or directory -- Test (LoadError)
>Exit code: 1

Test Program.rb obviously being what I named the program.  Is it in the wrong directory or something?  Or is there another compiler I can use?  I'm trying to learn Ruby so I can eventually do some stuff in RGSS, so I'm kinda at a roadblock till I can find a way to make the compiler work.

Edit:  On second thought this should probably be in the RGSS forum, eh?
 
First of all SciTE isn't a compiler, there is no compiler for ruby as it's a scripting language and not a programming language.
if you installed it correctly you should be able to just double click the .rb file to run it.  :thumb:
 
I downloaded SciTE just to see what you're talking about and I found that it modifies multiple languages by defining very basic syntax markups, similar to TextPad.  Try editing the ruby data file by going to Options -> Open ruby.properties (near the bottom of the menu, it scrolls, or should, if your version is similar to mine).

Then, look near the bottom for the text "PLAT_WIN", you'll notice it has the following:
Code:
command.go.*.rb=ruby $(FileNameExt)
. . . (removed) . . .
command.go.*.rbw=rubyw $(FileNameExt)
. . . (removed) . . .

I think the issue is in order to have filenames with spaces, you'll need to alter how it passes the filename to Ruby:
Code:
command.go.*.rb=ruby "$(FileNameExt)"
. . . (removed) . . .
command.go.*.rbw=rubyw "$(FileNameExt)"
. . . (removed) . . .
All I changed was adding quotes around the '$(FileNameExt)' parts on both commands.

You'll also notice that this makes SciTE a compiler front-end, not a compiler itself, since it calls the compiler itself.

I'm not sure if this will fix your problem, but I do know that typically programs have their command arguments pre-processed before it enters the main method, and quoted elements have the quotes removed.  So when the program sends in Test program.rb, as "Test program.rb" it should be received in its original form, Test program.rb.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top