Rails 3 - Production Environment

Hello Everyone,

I need some help related to the below requirements:

-> I need to setup production environment without installing Ruby or Rails or other related gems into it. I did accomplish the same using JRuby, bundler and warbler plugin. And deployed the WAR file into Apache Tomcat server. But now I have to do this without JRuby & Apache Tomcat.

-> I have to setup Apache with Passenger module in production environment. So is there any way to just install and configure apache and passenger alone, and no need to install Ruby or Rails or any other gems?

-> Performance wise - which is better among the following options: 1) Apache + Passenger (using Ruby) 2) Ngnix + Passenger (using Ruby) 3) Apache + Mongrel cluster (using Ruby) 4) Tomcat using JRuby 5) Glassfish + Apache using JRuby

-> I personally found in development machines that Ruby (webrick) is faster than JRuby (webrick). Am I correct? Will it be the same in Production environment too?

Also, let me know if there is any tutorial for installing and configuring Apache & Passenger module.

Thanks in advance.

Regards, Vasanth

Can anyone shed some light on this?

Hello Vasanth!

First of all, you need to install Ruby. Passenger depends on Ruby.

Next, you install passenger (just use `gem install passenger` and take a look at manual on the passenger website). I would recommend to you use Apache/Passenger, because it's probably the easiest environment to set up. Performance *may* be slightly better with a different setup (honestly I don't know for sure).

Finally, you need to install Rails and other Gems your application depends on. This isn't a big issue if you are using Rails 3.0. If you hit a culprit, just take a look at the documentation. In case you are looking to automate your deployment process, check out capistrano.

Disclaimer: Please try to ask a more specific questions in the future. If you are looking for a tutorial, the mailing list isn't right place to go.

Best regards, Christoph

→ I personally found in development machines that Ruby (webrick) is faster than JRuby (webrick). Am I correct? Will it be the same in Production environment too?

This is incorrect. Running a rails application in development environment is different from production. By default, development reloads all models so you can develop faster. Additionally, JRuby has a very slow startup time due to JVM warmup time but once it’s running, it should be faster. I wouldn’t recommend using webrick in production.

Nginx/passenger is a good start for serving rails 3.

Nginx/Jetty would be good if you use jruby. Just warble your war and drop it in.