How does Pow/Phusion Passenger/Webrick work?

1k Views Asked by At

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?

1

There are 1 best solutions below

5
On

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