TK.
TK.

Reputation: 28153

Running more than Rails apps on a local Mac

I would like to set up multiple Rails apps running simultaneously.

I'm using a basic installation with Rails and Mongrel. I'm pretty newbie when it comes to a server side thing.

What kind of options do I have to run multiple Rails app running at the same time on a local Mac?

Upvotes: 4

Views: 2061

Answers (5)

Shane Simmons
Shane Simmons

Reputation: 1

Initially, I used mongrel on different ports. Works just fine. But, as agregoire mentioned, Phusion Passenger and the Passenger PrefPane make your life so much easier. Checkout Ryan Bates's RailsCast, Passenger in Development, for a good tutorial on setting it up.

Upvotes: 0

agregoire
agregoire

Reputation: 2052

If you end up using Phusion Passenger, the Passenger Preference Pane can automatically configure your Apache virtual hosts for you. It's a lot easier than editing the Apache configuration and your /etc/hosts file each time you want to set up a new application.

Upvotes: 6

nas
nas

Reputation: 3696

Generally you start rails server using webrick or mongrel like

script/server

and

mongrel_rails start

respectively, that starts your server on port 3000 by default, ie. you can access your app on localhost:3000

To have multiple rails apps running on same machine, just start the servers by going to different rails application root directories on different ports like so

script/server -p 3001

or

mongrel_rails start -p 3001

Just for info, if you want to start rails apps in different environments then just pass -e option when you start the server like so

script/server -e production

or

script/server -e test_or_anyotherenv

If you don't give -e option, then it will by default start the server in development environment.

Upvotes: 2

Jimmy Stenke
Jimmy Stenke

Reputation: 11220

The only thing that stops you from running multiple rails apps on one machine is the ports.

If you want to run several apps while developing just use script/server -p <port number> for each of the apps.

If you have a production machine set up, I would recommend you to use phusion passenger with apache or nginx, and set up different virtual machines (or ports)

Upvotes: 8

owo
owo

Reputation: 971

I'm a Django (not Rails) coder, but I think you should launch the servers at different ports.

Upvotes: 0

Related Questions