I need help! (Passenger Rails 2.1.0?)

I have a few questions and I am having a very hard time finding concrete answers to them.

The first and I think shortest one, is when I have passenger enabled, which dispatcher is being called? the Dreamhost wiki says to make sure my shebang is set correctly in ‘dispatch.fcgi’ but other places say dispatch.rb. I’m confused about the nomenclature here as well because my domain has fastcgi off (just passenger checked) so how does that correlate to the ‘.fcgi’? I just edited the shebang in all 3 dispatchers for the sake of it, but if I’d love to know which one specifically get used for the sake of that whole G.I.Joe thing.

Now on to my ‘problem’ (which I’m sure is just my lack of knowing what is going on):

I have passenger enabled on my subdomain and my site directory set up to the appname/public directory. When I go to the subdomain on my site, I see the welcome to rails page. Any action that should invoke rails results in Passenger saying that rails 2.1.0 is not installed.

It is - gem list has passenger 2.1.0 and all dependancies and such all listed and if I run dispatch.rb (or.fcgi or anything) it works. It’s only going through the web that does not work.

packages (readline, ruby enterprise, gem) are installed in .local/bin

gems are installed in .gems (which rails = “home/username/.gems/bin/rails”)


export PATH="$HOME/.local/bin:$HOME/.gems/bin:${PATH}“
export RUBYLIB=”$HOME/.local/lib"
export GEM_HOME="$HOME/.gems"
export GEM_PATH="$HOME/.local/lib/ruby/gems/1.8:$GEM_HOME"

** I also tried adding the usr/lib/ruby/gems/1.8 in to the GEM_PATH to no avail. I was also concerned that if I did this, I would just be using rails 2.0.2 anyway

gemhome: /home/myusername/.gems

  • /home/myusername/.gems
  • /home/myusername/.local/lib/ruby/gems/1.8

When I commnet out the version information for rails in my environment.rb file, instead of “2.1.0 not found” I get 2.0.2 failed to start. This leads me to believe that passenger is not looking in the right spot(s) for my gems? In environment.rb I have the ENV[‘GEM_HOME’] set to the same as my .bashrc (except hard pathed /home/username/ not $HOME)

Eek. I don’t know what is wrong. In a fit of confusion I actually installed the passenger 1.0.5 gem and tried to set RailsSpawnServer to the one in my .gems/bin and I’ve also tried setting RailsRuby to the path to my ruby bin. I don’t even know if these work in .htaccess or if they have to be in the .conf file that I don’t have access to as a shared hostee?

Boy am I lost.

edit: Adding the dreamhost gem path to the $GEM_PATH AND commenting the rails version in environment.rb does let rails work and when I output Rails::VERSION::STRING it is 2.1.0 but I suspect that this is merely a constant somewhere because as soon as I take out the coment it says it can’t load 2.1.0 again.

More fiddling:

If I comment ouf the “RAILS_GEM_VERSION” part and instead use:

gem ‘rails’, '=2.1.0’
require ‘Rails’

I get:

RubyGem version error: rails(0.14.3 not = 2.1.0)

However if I use rake and freeze my rails version it works as 2.1.0 with all the gems unpacked

Where is 0.14.3 coming from?

I am not very experienced with this subject, so take me lightly…
but, what I see, is that,
the fullpath in you environment.rb could be the culprit:
I my experience with dreamhost fullpath, sometimes I need to put a funky directory just between /home/ and my user… in my case its something like /home/.helmut/myUser …
try ‘pwd’ while in the shell (ssh) of your user to know your fullpath, and use it in your environment.rb… maybe that could do it.

btw, does anybody knows if dreamhost use ‘Ruby Enterprise Edition’ with passenger to get to benefit from the 33% memory gain its improve garbage collector gives… or has anybody been able to install ‘Ruby Enterprise Edition’ on a standard shared user… mine gets killed while installing gems, memory footprint too big I’ve read somewhere…

I saw that! Mine is .stevester

However pwd shows /home/myusername

I will try .stevester anyway

As for Ruby Enterprise, I had it installed and I just installed gems locally with gem install -l

You could also try:

nice -n19 gem install [gemname]

which I read somewhere on the wiki, apparently it has less chance to get killed or something.

thanks for your input and hopefully mine helps you

No go.

I edited my environment.rb to include .stevester in the path. I have also set environment.rb to specifcy ENV[‘x’] as such:


identically to my .bashrc

I also edited the shebang in all 3 dispatchers in /public/ to include .stevester.

I have set up my routes to have my root go to a controller called ‘mytest’. This controller outputs Rails::Info.to_html.

If I run ./dispatch.rb it renders mytest and Rails::Info shows Ruby 1.8.7 (I had deleted everything and installed that just out of fooling around) and RubyGems 1.1.1.

If I go to my site the same output (same controller) is Ruby 1.8.5 with rubygems 0.9.5

have you had any luck with this?