New to Ruby, a few questions about the best method to deploy.

0 views
Skip to first unread message

Luke

unread,
Mar 11, 2009, 9:03:58 AM3/11/09
to Phusion Passenger Discussions
I am new to Ruby and am just about to start learning how to develop a
Ruby on Rails website. I have been interested in Ruby on Rails for
some time now, from what I have read there are an awful lot of
different ways to deploy ruby on rails on a server.

The official rails website recommends you use Ruby 1.8.7, although
Ruby 1.9.1 has been released recently, would using 1.9.1 not work?
They use Apache/Passenger to power their site. The official rails wiki
also has guides on installing Apache/Passenger or Apache/Mongrel.

The official Passenger site then goes on to recommend using Ruby
Enterprise - but I am not keen on using that as it isn't the official
Ruby release. Also another strange thing is the official Passenger
site is using nginx, even though the benchmarks indicate using
mod_rails and ruby enterprise is the best thing to do. Makes me a bit
weary of using something that doesn't practice what it preaches.

Engine Yard seem to be using nginx. Slicehost seem to be using Apache/
Mongrel/Lighttpd.

Has the best method of deployment been decided on yet? I have read
quite a bit that seems to suggest that it can potentially be difficult
to set up a stable and scalable deployment of Ruby on Rails, so I want
to make sure I am using the best method of deployment.

Thanks in advance.

Roderick van Domburg

unread,
Mar 11, 2009, 9:17:51 AM3/11/09
to phusion-...@googlegroups.com
Luke wrote:
> The official rails website recommends you use Ruby 1.8.7, although
> Ruby 1.9.1 has been released recently, would using 1.9.1 not work?
> They use Apache/Passenger to power their site. The official rails wiki
> also has guides on installing Apache/Passenger or Apache/Mongrel.
>
Many libraries are not compatible yet with 1.9, so most Rails projects
stick with 1.8. Actually 1.8.6 is a lot more popular than 1.8.7,
likewise due to various incompatibilities.

> The official Passenger site then goes on to recommend using Ruby
> Enterprise - but I am not keen on using that as it isn't the official
> Ruby release. Also another strange thing is the official Passenger
> site is using nginx, even though the benchmarks indicate using
> mod_rails and ruby enterprise is the best thing to do. Makes me a bit
> weary of using something that doesn't practice what it preaches.
>
Ruby Enterprise Edition is on a patchlevel that is different and higher
than most Ruby packages from OS distributions. It passes more tests from
the RubySpec project than other patchlevels, so based on that's it's "a
more compatible Ruby".

The Passenger site uses nginx to serve static pages and proxies dynamic
pages to a Apache/Passenger server. Hong Li wrote about this on his blog.


> Has the best method of deployment been decided on yet? I have read
> quite a bit that seems to suggest that it can potentially be difficult
> to set up a stable and scalable deployment of Ruby on Rails, so I want
> to make sure I am using the best method of deployment.
>

We've switched from Mongrel to Passenger + REE and haven't looked back.
As always, you should choose what works best for you.

--
Roderick van Domburg
http://www.railscluster.nl

Hongli Lai

unread,
Mar 11, 2009, 9:45:16 AM3/11/09
to phusion-...@googlegroups.com
Luke wrote:
> I am new to Ruby and am just about to start learning how to develop a
> Ruby on Rails website. I have been interested in Ruby on Rails for
> some time now, from what I have read there are an awful lot of
> different ways to deploy ruby on rails on a server.
>
> The official rails website recommends you use Ruby 1.8.7, although
> Ruby 1.9.1 has been released recently, would using 1.9.1 not work?

Ruby 1.9 is a different release series. Many libraries aren't compatible
with 1.9 yet. For now you should stick with 1.8.


> The official Passenger site then goes on to recommend using Ruby
> Enterprise - but I am not keen on using that as it isn't the official
> Ruby release.

Phusion Passenger works just fine with normal Ruby. Ruby Enterprise
Edition is totally optional -- but if you do use it, then things will
work more efficiently.


> Also another strange thing is the official Passenger
> site is using nginx, even though the benchmarks indicate using
> mod_rails and ruby enterprise is the best thing to do. Makes me a bit
> weary of using something that doesn't practice what it preaches.

1. We run Apache behind an Nginx reverse proxy:
http://izumi.plan99.net/blog/index.php/2008/08/22/re-strange-http-header/

2. www.modrails.com is just a static website with static .html files.
It's not written in Ruby on Rails. All our Rails applications however
are deployed on Apache, but behind an Nginx reverse proxy.


> Engine Yard seem to be using nginx. Slicehost seem to be using Apache/
> Mongrel/Lighttpd.
>
> Has the best method of deployment been decided on yet? I have read
> quite a bit that seems to suggest that it can potentially be difficult
> to set up a stable and scalable deployment of Ruby on Rails, so I want
> to make sure I am using the best method of deployment.

The Ruby on Rails website recommends Phusion Passenger as deployment
method: http://rubyonrails.org/deploy

There are many high-profile organizations using Phusion Passenger,
including:

- MTV
- New York Times
- LocaWeb (Brazil's largest web host)
- Aboutus.org (very busy site; see Alexa ranking)
- Shopify
- Dreamhost
- RailsMachine

See
http://groups.google.com/group/phusion-passenger/browse_thread/thread/521dd6281331dd9e/bce07da3064c420d
for a bigger list.

Regards,
Hongli Lai
--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Bob Martens

unread,
Mar 11, 2009, 10:01:40 AM3/11/09
to Phusion Passenger Discussions
On Mar 11, 8:03 am, Luke <m...@lukearmstrong.co.uk> wrote:
> I am new to Ruby and am just about to start learning how to develop a
> Ruby on Rails website. I have been interested in Ruby on Rails for
> some time now, from what I have read there are an awful lot of
> different ways to deploy ruby on rails on a server.

Welcome to our wonderful community, I hope you have fun.

> The official rails website recommends you use Ruby 1.8.7, although
> Ruby 1.9.1 has been released recently, would using 1.9.1 not work?

I would recommend sticking with 1.8.7 right now, but if you are very
adventurous, feel free to give 1.9.1 a shot. There are a lot of
changes, but I guess someone has to try it out at some time. ;)

> They use Apache/Passenger to power their site. The official rails wiki
> also has guides on installing Apache/Passenger or Apache/Mongrel.
>
> The official Passenger site then goes on to recommend using Ruby
> Enterprise - but I am not keen on using that as it isn't the official
> Ruby release. Also another strange thing is the official Passenger
> site is using nginx, even though the benchmarks indicate using
> mod_rails and ruby enterprise is the best thing to do. Makes me a bit
> weary of using something that doesn't practice what it preaches.

I would recommend that you use whichever Ruby edition you feel better
with. If you feel comfortable with MRI, then use MRI. If you want to
try out Ruby Enterprise Edition, then try it out. There is no harm in
trying out things.

nginx is very common to use as a load balancer or proxy, so I wouldn't
exactly jump to conclusions right off of the bat. They responded
above, however, so I guess my point is moot.

> Engine Yard seem to be using nginx. Slicehost seem to be using Apache/
> Mongrel/Lighttpd.

Both of those sites have been around a lot longer than Passenger has,
but I believe that both readily embrace Passenger at the same time. I
know that Slicehost offers many tutorials, including how to set up
your own Rails site using Passenger as the application server.

> Has the best method of deployment been decided on yet? I have read
> quite a bit that seems to suggest that it can potentially be difficult
> to set up a stable and scalable deployment of Ruby on Rails, so I want
> to make sure I am using the best method of deployment.

Deployment is as easy or as difficult as you want it to be. Best
method? You're asking for opinions with that one, and you are going to
get varied opinions as answers. The most common answer is "it depends
on your needs," but at the moment I have settled into a server running
Ubuntu/Apache/Passenger and I deploy my applications using Git/
Capistrano. I could cut out Capistrano is I wanted, and am planning on
trying out Vlad, but nothing that I have listed could be considered
"hard" by anyone who can follow directions and do a little bit of
critical thinking.

The Passenger guys should be commended for the work they have done and
are continuing to do. Their work has been exemplary, and I look
forward to continuing to use their products.

> Thanks in advance.

No problem, I like writing. ;)

Luke

unread,
Mar 11, 2009, 11:05:51 AM3/11/09
to Phusion Passenger Discussions
Thanks for the advice, very quick and comprehensive responses. I will
be hosting PHP and Ruby on Rails websites with this server so am
considering the following setup, all installed from source, except
rails and passenger which I should probably install using ruby gems?

- Apache 2.2.11 (Worker MPM)
- PHP 5.2.9 (using mod_fcgi)
- Ruby 1.8.7
- Ruby Gems 1.3.1
- mod_rails 2.0.6

I haven't used nginx before, and not keen on installing it as it will
only be another thing to go wrong. I don't have an opinion about nginx
or your reasons for using it, I just don't feel confident about
setting it up.

Hongli Lai

unread,
Mar 11, 2009, 11:16:45 AM3/11/09
to phusion-...@googlegroups.com
Luke wrote:
> Thanks for the advice, very quick and comprehensive responses. I will
> be hosting PHP and Ruby on Rails websites with this server so am
> considering the following setup, all installed from source, except
> rails and passenger which I should probably install using ruby gems?
>
> - Apache 2.2.11 (Worker MPM)
> - PHP 5.2.9 (using mod_fcgi)
> - Ruby 1.8.7
> - Ruby Gems 1.3.1
> - mod_rails 2.0.6

Yeah, looks good.

Greg Donald

unread,
Mar 11, 2009, 11:17:26 AM3/11/09
to phusion-...@googlegroups.com
On Wed, Mar 11, 2009 at 10:05 AM, Luke <m...@lukearmstrong.co.uk> wrote:
> I haven't used nginx before, and not keen on installing it as it will
> only be another thing to go wrong. I don't have an opinion about nginx
> or your reasons for using it, I just don't feel confident about
> setting it up.


If you can run Apache and are capable of setting up all the things you
listed, you can run Nginx. I found it extremely simple to get going.


--
Greg Donald
http://destiney.com/

Bob Martens

unread,
Mar 11, 2009, 12:18:31 PM3/11/09
to Phusion Passenger Discussions
On Mar 11, 10:05 am, Luke <m...@lukearmstrong.co.uk> wrote:
> - Apache 2.2.11 (Worker MPM)
> - PHP 5.2.9 (using mod_fcgi)
> - Ruby 1.8.7
> - Ruby Gems 1.3.1
> - mod_rails 2.0.6

That seems extremely reasonable, and I think you'll be very happy with
the setup.

> I haven't used nginx before, and not keen on installing it as it will
> only be another thing to go wrong. I don't have an opinion about nginx
> or your reasons for using it, I just don't feel confident about
> setting it up.

I don't know if you'll need nginx, but I found it extremely easy to
set up and might be appropriate in some environments. Maybe you'll
give it a try in the future.

Donovan Bray

unread,
Mar 11, 2009, 9:21:19 PM3/11/09
to phusion-...@googlegroups.com
We use nginx to load balance our apache/passenger/ruby enterprise app
servers. It's a great combo.
Reply all
Reply to author
Forward
0 new messages