i am a beginner to ruby . i just did some minor research about why RUBY ? why choose RUBY ? whats new in it. Whenever i do type in a word RUBY in google search there comes a suggestion like RUBY on RAILS . so my mind changed to learn stuffs about ruby on rails.

I went through some forums but got the same answer from everyone. RUBY ON RAILS is a web development FRAMEWORK . once again i learnt stuffs about what a framework is. There are lot of questions which is u know like itching my mind.Varieties of answer from everyone. i dont know which is the right one.

first if anyone wish to give me a reply .. tell me solution for this.

just like java we run ruby programs in command prompt by moving to the directory in cmd where ruby is installed.it is similar to java. so can we create a desktop application by using it.i mean like a file searching program which is default in windows . We can create the same file searching program using java swing and playing with some string functions isn't it? can we do the same with ruby .? thats my first one.

i will raise doubts on ruby on rails after i get cleared about the above question.


Yes, you can use Ruby for desktop applications (if it's a good choice is another question and may depend on the project). In addition to Ruby itself you will need some kind of widget toolkit or application framework that allows you to create windows and other GUI elements for the underlying operating system.

For Ruby exist bindings to several such toolkits like WxRuby to WxWidgets, FXRuby to FOX or QtRuby to the Qt framework (and a few more like ruby-gnome, ruby-tk, shoesrb, limelight, visual ruby). Or you can use JRuby and then use mostly anything available for Java.

Frameworks: there are many, sometimes quite different from each other. But as a general rule they are a combination of libraries and rules and boilerplate codes that make a certain complex task easier. This task may be something like a web site or a desktop application.

To start with for such a task you will need many libraries for the underlying tasks. You will use some database library to interface the database, some gui library to create windows, menus, buttons and other widgets. There are many ways to do this and many optional development patterns. MVC (Model View Controller) is quite fashionable, especially in web development with its special requirements.

So lets talk about Rails again. You need a model (database & business rules), a controller (take incoming request, gather data, process data and then tell the view to render the response web page) and the view (actually generating the html).

Many libraries are there to help with that and a lot of decisions to be made about how to organize your classes and file structure. Rails gives you a lot of defaults for that that work for a lot of typical projects.

In addition the framework will provide a lot of libraries of its own that help with the specific task. Rails for example makes it very easy to define models, validations and relations between models. It has helpers for the routing, for the controllers and in the view part for creating html, including javascript and integrating additional libraries and whole toolchains like the asset pipeline (generating CSS from SASS, JavaScript from CoffeeScript, minifying JavaScript and more of the more tedious everyday tasks in web dev).

The whole framework thing is a kind of project scaffolding that you than fill with your own code. If you start a new Rails project you have already have a database connection in place and some basic html rendering where otherwise you would have to write hundreds of lines of code to even get started.

| improve this answer | |
  • oh yeah. i can understand. but you said some application framework to be used along with ruby to create desktop app isn't it. so what do you mean by that . ? A FRAMEWORK ? . we use a framework so that we can make things get done.? say for example if creating and maintaining a session in php is complex then we go for a framework.framework make its easier.Am i right with this? – viki_viki Jan 17 '14 at 10:49
  • That was really an EPIC reply i got brother . I am cleared. though your reply has a lot of technical stuffs but you made it easier for me by giving awesome definitions inside brackets . i got it clearly. Really Coooooool . – viki_viki Jan 17 '14 at 11:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.