Reputation: 1511
In more details... I have a CentOS machine running Passenger alongside other Apache/httpd projects (PHP) and I wonder if there is some way I can upgrade my Ruby version without breaking any current running projects. I found a lot of examples on upgrading which are fine but they all include reinstalling rails and in some cases rubygems. They even require you to pass some code in your controller for encoding utf-8. There is no time doing this because it is a live server running sharp projects.
I wonder if you can do something like this:
E.g
I don't have RVM installed because I thought it included more hassle than just installing Ruby itself.
Everyone's talking so good about the performance in version 1.9.X I thought it might be worth the upgrade.
Upvotes: 2
Views: 1413
Reputation: 17412
If you install Ruby 1.9.2 to a different location (e.g. /usr/bin/ruby1.9 or /usr/local/bin/ruby), you could update without a major downtime. You would have to recompile your gems though.
Haven't tried that, so wait for some comments about flaws in this workflow.
It's also possible to use multiple ruby versions in the same webserver using Passenger 3, see http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ for details. You could set up a ruby 1.9 app with Passenger stand alone and test everything before switching.
Upvotes: 0
Reputation: 49354
AFAIK - no, you cannot do that because some gems (including passenger) have native extensions (read: have parts written in C), which are compiled with 1.8.7 version headers/code. They'd most probably are incompatible with ruby 1.9.x. Also, ruby's stdlib is in different location (maybe this could be changed by some env variable?). But still, main issue stays the native extensions for gems.
Upvotes: 3