views:

619

answers:

3

Is Ruby client- or server-side?

+7  A: 

Both?

After all, there are Ruby programs which are not used as part of a client-server architecture.

If you are talking about Ruby on Rails, then it's typically only used on the server side.

Cade Roux
+2  A: 

Ruby does not (typically) execute in the browser, so if you are asking this in the context of a web server/client browser, then Ruby is server-side.

You can of course also execute stand-alone Ruby code on any machine with a Ruby interpreter. It is not confined to web applications.

+1  A: 

Ruby is an all-purpose script/programming language which can be executed on both client and server environments.

As client-side, you can use it to create a GUI application (or CLI one) to interact with data, communicate with a server, play with media/game, etc. Some framework examples on this level would beShoes, MacRuby, etc.

As server-side, you can use it to store and save data, validate and execute transactions, etc. It's where frameworks like Rails, Merb, Sinatra and others take place, and its -arguably- it's most known mode of operation.

As the previous poster said, on the context of a server/client web application arquitecture, Ruby would be run on the server side. If I'm not mistaken, there have been some advances for running Ruby through the browser (like JS does), but probably not something to be considered for production ready needs.

Yaraher