1

I come from a PHP and .NET world where I understand the environment fairly well. However I can't find a newbie explanation of how the Ruby / Ruby on Rails stack actually work with these web server.

Are they more close to the PHP model, where all classes of an application are loader for each request and there is no default shared memory, or is it like an application server where an active app sits in the memory and handles requests?

How is it with reloading when a file changes? Does the app in an application server has to be restarted? How does it know? Does it monitor file system?

I have seen that both the Ruby Version Manager (rvm) and the newer rbenv from 37signals shomewhat shuffles with the ruby command on OS X / Linux. This seems like a total magic to me. Does a webserver just runs ruby command and does not care where the interpreter is resolved in the $PATH?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
tillda
  • 18,150
  • 16
  • 51
  • 70

1 Answers1

0

Webrick is the default server of Rails and is usually used for developing and testing. Rails is session based like PHP is. If you want to run in production you will generally use Phusion Passenger on Apache or Nginx, dont worry about that for now.

If you run in Development or Test environment you can edit your application files(views, controllers and models) and they will be reloaded on each request (even if they are not edited).

Have a look at generating a project and scafolds with Rails to get you started.

http://guides.rubyonrails.org/getting_started.html

Ben
  • 13,297
  • 4
  • 47
  • 68
  • Thanks for answering. But the thing is that I have already built a few apps on Rails without understanding this and all of the "getting started" guides deal with the typical easy stuff like generating a bunch of classes... – tillda Oct 19 '11 at 00:23
  • In that case maybe its time to hook up mysql and run rails in production on passenger – Ben Oct 19 '11 at 00:24
  • Or build something you make up, with your php knowledge, ruby should be easy enough to pick up. If you have trouble understanding the structure of a app its time to ready up on Model View Controller design pattern and how they work in Rails. – Ben Oct 19 '11 at 00:26
  • Ben, I have no problems with the programming concepts, I'd just like to understand the *stack* better from the unix background up. – tillda Oct 19 '11 at 00:42
  • There is a great article about yet another server called Unicorn. Please loot at this: https://github.com/blog/517-unicorn. Hope it help you to better understand ruby hosting infrastructure. – WarHog Oct 19 '11 at 05:27