Phusion Passenger with Ruby 1.8 and 1.9

Phusion Passenger with Ruby 1.8 and 1.9?

I ended up running Nginx with Passenger and Ruby 1.9 on port 80, and then proxying off my other virtual hosts to Apache 2.2 on port 8080 with Passenger and Ruby 1.8. Win!

Phusion passenger and running multiple ruby version with apache

You can't run multiple ruby version simultaneously within a single phussion passenger configuration. If this is the case then one should run with the standalone server (let's say on port 4000) and the you should configure apache to run as a proxy on that port. See http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ for more information.

phusion passenger and ruby 1.9.1 is it working already?

Yes it's officially supported since some 2.2.x release for which I can't remember the exact number. It was written in the release notes. The past few 2.2 releases have only continued to add 1.9-related bug fixes. The upcoming 3.0 release will officially support 1.9.2 as well (though this doesn't imply that 1.9.2 doesn't already work).

You can't run two Ruby versions simultaneously yet but it's on the todo list.

Phusion-passenger compiles extension for wrong ruby when using RVM

Turns out that apparently while installing newer Rake gem, I had had the environment wrong and though the gem ended up in RVM under 1.9.2, it actually referenced system 1.8.7 binary and that Passenger install script ran this rake, which in turn built the module against wrong ruby.

Helped to uninstall and reinstall Rake gem.

Phusion Passenger is throwing errors after upgrading Ruby and Rails using rvm

You're not using the RVM ruby in the Apache config, in your apache conf your pointing to the old system versions

 LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-3.0.11
PassengerRuby /usr/bin/ruby1.8

You need to use the 1.9.3 that RVM has installed, easiest way is to install the passenger gem again and look at the output, when it's compiled it'll give you the correct conf, mine looks something like:

LoadModule passenger_module /Users/admin/.rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.9/ext/apache2/mod_passenger.so
PassengerRoot /Users/admin/.rvm/gems/ruby-1.9.3-p0/gems/passenger-3.0.9
PassengerRuby /Users/admin/.rvm/wrappers/ruby-1.9.3-p0/ruby

Best way to deploy both Ruby 1.9.2 and 1.8.7 with RVM and Passenger on same server

There's a blog post explaining pretty much what you want by the phusion people here: http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/

(Actually it's the same info as the link given by Sam - but I think this is the original with clearer layout)

It basically involves running a version of passenger standalone with one version of ruby, and proxying requests to it from apache/nginx that is running the other version.

Issue with Phusion Passenger handling multiple projects with multiple RVM rubies

Go to the project directory and run the below commands one by one:

rvm use ruby-1.8.7-p374
gem install bundler passenger
rvm passenger-install-apache2-module

This will install passenger along with Apache module, mean while you will be asked to add some configuration changes to /etc/apache2/apache2.conf and do it as such.

Create a file in /etc/apache2/sites-available/ for your site (something like 'www.virtualx.com') and insert this:

<VirtualHost *>
# Change these 3 lines to suit your project
RailsEnv production
ServerName www.virtualx.com
DocumentRoot /var/www/my_project/public # Note the 'public' directory
</VirtualHost>

and set the PassengerRuby option to ruby-1.8.7-p374.

Restart Apache service. You are all done.

Now it will work ok.

If you need multiple ruby versions working simultaneously for different projects, then refer here.

Hope it helps :)

Configuring Passenger with Ruby 1.9.2 + Rails 3.1.0rc4 and Ruby 1.8.6 + Rails 2.3.11

Personally, I prefer nginx to Apache, but you can do this with both.

First, the bad news - you cannot do this with a single installation of either Apache or nginx - passenger is compiled against a single specific ruby interpreter that you are using. Now, the good news is that since you have rvm setup, it is trivial to manage multiple ruby interpreters.

You need to have two separate http server (Apache or nginx) installations - one will be the default and answer on port 80, and the other will need to answer on another port (this will not be publicly used). You need to compile passenger for one ruby and http server (Apache or nginx), and another passenger for the other ruby and http server (both http servers can be Apache, both can be nginx, or if you want to make things "interesting", you can have one of each). I highly recommend using ruby 1.9 with your default (port 80) passenger since any new apps you run on the server will be using ruby 1.9+/rails 3+.

Once you have each http server + ruby + passenger setup, you will need to configure your secondary site (running on the not-port-80 web server) as a proxy + reverse proxy from the port 80 http server to the secondary http server (e.g. port 5000).

I have this configuration running for a couple different clients (on different production servers) and do not have any trouble. In one case, we are using passenger standalone servers for the secondary ruby/passenger combination rather than having a full nginx installation - this has proven to be quite stable, but creating functional init scripts that worked as we wanted was a bit fun.

Update Phusion Passenger from 3.0.11 to 4.0.10 causes ActiveRecord::StatementInvalid Lost connection to MySQL server during query

Having updated my apps to ruby 1.9 the errors have ceased. I never found out what was causing them but I wanted to answer here in case anyone else runs into the same problem.

Why does installing libapache2-mod-passenger require Ruby 1.8?

Since you're mixing a ruby installation not coming from apt-get with a package of apt-get, issues will show, like you report.

You can avoid that by installing Passenger gem gem install passenger and proceeding to install the apache module following Passenger instructions:

http://www.modrails.com/install.html



Related Topics



Leave a reply



Submit