Running More Than Rails Applications On Local Mac

I would like to set up several Rails applications running at the same time.

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

What options should I run simultaneously with multiple Rails applications on the local Mac?

+4
source share
5 answers

The only thing that prevents you from running multiple applications on the same machine is the ports.

If you want to run several applications during development, just use script/server -p <port number> for each of the applications.

If you have a production machine installed, I would recommend that you use a phusion passenger with apache or nginx and configure various virtual machines (or ports)

+8
source

If you end up using Phusion Passenger, your user preferences panel can automatically configure Apache virtual hosts for you. This is much simpler than editing the Apache configuration and your /etc/hosts every time you want to configure a new application.

+6
source

Typically, you start the rails server using webrick or mongrel, for example

 script/server 

and

 mongrel_rails start 

respectively, which starts your server on port 3000 by default, i.e. you can access your application on localhost: 3000

To have several applications with rails running on the same computer, just start the servers by going to different application root directories on different ports, for example

 script/server -p 3001 

or

 mongrel_rails start -p 3001 

Just for information, if you want to run rails applications in different environments, then just pass the -e option when you start the server like this:

 script/server -e production 

or

 script/server -e test_or_anyotherenv 

If you do not specify the -e option, it will by default start the server in the development environment.

+2
source

I am a Django encoder (not Rails), but I think you should start the servers in different ports .

0
source

At first, I used mongrel on different ports. Works great. But as agregoire said, Phusion Passenger and Pass-PrefPane make your life a lot easier. Checkout Ryan Bates RailsCast, β€œPassenger In Development,” for a good set-up guide.

0
source

Source: https://habr.com/ru/post/1300548/


All Articles