Deploying apps with multiple ruby versions using Passenger - ruby-on-rails

Is this still the current state of deploying apps using different rubies with Passenger ? – http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ #rails # phusion_nl .
If it is, then its a mess.

It's the cleanest way to have independent instances of rails applications, read this tutorial to have some overview http://niczsoft.com/2011/03/passenger-standalone-with-god-on-rvm/

Related

Testing different Ruby versions with Passenger?

We are currently testing different Ruby versions (1.8 and 2.0). Ruby 1.8 is the system Ruby and 2.0 is installed via RVM.
For a variety of reasons, we do not want to move 1.8 to RVM in the fear of breaking things. We want to move to Ruby 2.0 throughout and, for testing, we need a way so that we can easily switch between Ruby 2.0 and 1.8 on our staging servers which is managed by Passenger.
Are there any good guides for doing the same?
The easiest way is probably to simply specify which Ruby you want Passenger to use. In 4.0.0 or later you can do this on a global basis with PassengerDefaultRuby, or it can be in the virtual host config on a site by site basis using PassengerRuby. Both of these options simply take the path to the ruby binary you wish to use. Documentation can be found here: http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerRuby
Note that you will have to restart Apache after making these config changes.

Multiple Rubies under apache in production server

I want to run multiple rubies on our production server. We have some ruby 1.9.3 rails 3.2 sites going live as well as keep older 1.8 sites. I understand that Passenger 3.2 will be able to do this natively but isn't live yet.
So for now, is this the best way to do this?
http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/
The apache passenger module can't do this. You could however run passenger standalone for each app (with a different ruby version) and then proxy from apache to passenger standalone.
You could of course also proxy to unicorn, thin etc.
What about using multiple VMs/Slices for your different versions of ruby and rails, that way you have more control of your enviroment and don't have to worry about your different rubies/rails causing headaches with each other.
EDIT
Another solution that I have heard of but haven't tried is setting multiple users and running each version of ruby/rails per a different user

Requirements to run Ruby on Rails on Server

I want to develop a website using Ruby on Rails.
What is the requirements for the Server, i.e. what do I have to tell the admin what I need. I believe the server will be running on a machine that is already hosting some websites which use PHP. I dont know more about that so far, and it will probably be depending on my requirements.
As far as I understood from documentation and other questions the server needs to have ruby, rails installed. It also said that I could use cgi.
My problem is that I need a concrete list of things that my admin should provide.
Another question suggests that the only thing is to intall Phusion Passenger if I can use an Apache Werbserver. This would seem like an option maybe.
So what do I really need?
Phusion Passenger is the easiest way to go in a mixed environment.
A Rails app needs these things:
ruby (ruby enterprise edition or MRI 1.9.2)
rubygems
sort of gems handled with bundler
You should try it with Passenger on Your local computer. Then you will see the list for the installation.

I want to start using Rails 3 and Ruby 1.9 but how can I still run my Rails 2 apps?

I have some production Rails 2 apps. I want to start using Rails 3 and Ruby 1.9 for new apps I develop.
I'm using Passenger and Apache with REE (Ruby 1.8.7). I don't vendor anything -- I install gems on the system level and specify versions per app in environment.rb.
If understand it right, the problem is not so much the Rails and other gem versions (because each app can specify their own in environment.rb), but whether my Rails 2 apps and their gems will run under Ruby 1.9.
Do I have that right?
Based on Googling it appears that there may actually be a problem with some gems like Searchlogic and Ruby 1.9.
If so what would be the recommended solution?
I have looked into RVM and it looks fantastic for testing, experimentation, and development. But it doesn't look like it was designed help with a production setup.
As I understand it, when you install Passenger you compile it against one particular version of Ruby. That Ruby can be under RVM no problem, but Passenger can't use different Rubies for different apps.
Look into RVM (Ruby Version Manager). You can manage multiple ruby versions on the same box, and multiple gemsets for each.
http://beginrescueend.com/
Additionally, Bundler allows projects to maintain their own libraries of gems (and for me at least, obviates the need for using RVM gemsets)
http://gembundler.com/
Check the following link for Hongli Lai from Phusion explaining how to set up Passenger running on multiple versions of Ruby simultaneously by using Passenger standalone and reverse proxy.
http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/

with RVM, can multiple rails sites using different rvm's with nginx and passenger?

with RVM, can multiple rails sites using different rvm's with nginx and passenger?
Passenger 3 has support for this. You need to set up reverse proxying, pick which will be your default ruby, and use Passenger Standalone on a different port for each non-default version of ruby you want to use.
Have a read of this article on the Phusion blog - it explains it better than me.
See Installing RVM System Wide and Deployment Best Practices.

Resources