I want to launch many passenger with many version of ruby installed and with différent gemset, etc… RVM is a part of the solution but can’t allow to execute different version of passenger.
I want to find a way to use passenger with many version of rails and many versions of ruby. For the first problem we can use bundler but for the second, it is a problem. If we want use many ruby versions, passenger recommand this way : http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ . So We can see that passenger team say we can use passenger as standalone and launch each instance as daemon. It is quite easy but the problem if your server crash or anything else you have to relaunch each instance of passenger by hand. It’s so boring…
Here is a script which allow to centralize the execution of daemons. You can find passengers on Gitorious.
You have to specify configuration in /etc/passenger-projects like this :
;Config sample for passengers
;Default path for this config file: /etc/passenger-project
;You can customize this path in the passengers script (CONFIG_FILE)
;- user - default: 'passenger'
;- env - default: production
;- socket_path - default: /var/run/passenger/[project_name].socket
;- pid_path - default: /var/run/passenger/[project_name].pid
;- gemset - add this to use rvm with a specific gemset or ruby version
You can now use the script :
$ passengers start
$ passengers start gitorious
The allowed action are “start, stop, status”. You can start, stop each daemon automatically
Hope this can helps others