I’ve got a Ruby project started with NetBeans, so the Rake file has been generated. Is there a way that I can run the project over the command line?
It runs fine when I use F6 through NetBeans, as does my automated test suite with Alt+F6. I’m essentially looking for something like…
$ rake run
Does this exist?
The goal of ruby programming is (generally) to either write a web application, or write a program that can be run from the command line.
For a web application a
rake runoption might be worthwhile, but really the most common web applicaition framework is Rails, and for rails, you can just run a dedicated webserver running your web app withscript/server.For a commandline program, just run whichever ruby file you have intended as the main file (the one with the code that runs at startup). Ruby doesn’t have any of the difficulties that Java does (e.g. having a jar file with the right
Main-classattribute, and getting the classpath right, etc…). So you don’t really need arake runtarget, because there’s no complexity that needs to be hidden in the rakefile.