views:

52

answers:

2

I'm using VirtualBox on Windows to run an Ubuntu OS, which is running the turnkey rails package, which comes with ruby 1.8, rails 2.3.8, and passenger 2.2.5. When I first booted it up with just a vanilla rails app it worked fine, but now I'm getting the following error:

uninitialized constant PhusionPassenger::Utils::PseudoIO::StringIO

I googled this, and on the phusion/google groups it said this was an old error and to upgrade passenger, which I did with gem upgrade passenger. It said it was installing passenger 2.2.15, but it doesn't appear to be using it. I re-started the whole virtualbox and it is still giving me the same error, with the backtrace showing passenger-2.2.5.

I realize there are several layers here and plenty of places for things to go wrong, and to add to that, I'm pretty much a Linux newb. I've got some experience with rails. I'd appreciate any help.

A: 

Try using

gem list

to make sure the new version was installed. Next to the passenger gem should see more than version listed.

You can use

gem clean

to remove old versions.

Jarrod
thanks, that apparently worked to clean out the old versions, but had the unfortunate side effect of hosing my rails install; I can't even get it to respond with the basic 'Your on Rails' page; I'm trying to check logs; there were other older gems that were uninstalled as well, perhaps that is the problem
If it hosed the setup, maybe a fresh install would be better. RVM, Ruby 1.9, Rails 3 beta (very stable now). RVM makes managing Ruby installs simple on Linux.
Jarrod
A: 

It could well be your Apache configuration file. When Passenger installs it adds some code to the /etc/apache2/http.conf file so that Apache loads the Passenger extension. This code includes the version number so if you've changed the version of Apache you'll need to modify this file. The code you're looking for looks like this

LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /opt/local/bin/ruby

You'll have to be authenticated to edit the file so open a terminal window and type

sudo gedit /etc/apache2/http.conf

and enter your password to edit the file. Once you've made the changes close gedit then run

sudo /etc/init.d/apache2 restart

to restart Apache and try your Rails application again.

Eifion
yes, this was the answer, although in my case it was one level deeper: there was an include in http.conf that led to another directory or file for passenger, and in that file I found the lines listed above