[TIP] Ruby GUI Applications and Empty Console Window
Aug 6, 2008
bawigga
1 minute read

While writing a Ruby GUI app I kept seeing an empty console window. As it turns out there are two ruby executables that you can use to run your Ruby scripts: ruby, which is a CUI (Console User Interface) and rubyw, a GUI (Graphical User Interface) used to launch GUI Apps. Using rubyw will prevent that empty console from showing up. Hope this helps someone!

# rubyw myapp.rb

Edit – 8/7/08

There are actually two filetypes you can use for your ruby scripts. .rb files will run with the ruby CLI interpreter, while .rbw scripts will run with the GUI interpreter. Remember though, with no console window you wont get any status messages or debug messages. While writing and testing your GUI apps use the ruby interpreter then when your finished change the filetype to .rbw.



comments powered by Disqus