Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I know if I make a change to a Rails\Ruby application that restarting mongrel is required to see the changes take effect. I was just curious if mongrel actually uses a compiled version of the application rather than interpreting it on the fly like say PHP is usually done?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

When running in the Development environment, you do not need to restart Mongrel to have changes in the source applied immediately (Rails checks if the source file of any class descended from one of the Rails classes has changed before using that class).

When running in the Production environment, you must restart for every change.

In all cases, if the file is not one that Rails knows about (e.g. your own module or class) or is a configuration file then you must restart Mongrel to have the change take effect.

Note that this is a feature of Rails, not Ruby

share|improve this answer

To answer part of the question - no, Ruby does not get compiled into any sort of intermediate file-based bytecode (unlike, say, Java's class files). But as Chris said, when running Rails in production mode you do have to restart the process to reload the source code.

One advantage of using Passenger vs Mongrel is that with Passenger you can cause the application to be restarted on the next HTTP request by doing a touch tmp/restart.txt in the application's current/ directory.

share|improve this answer

I believe that it's not compiled, but that certain files (such as database.yml and routes.rb) are only read at startup. If you change (for example) a view then the change should take effect immediately.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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