Passenger Problems


#1

So I’ve gone through just about all the material I can find trying to
solve this with no luck, so I figure you all might be able to help.

I’m trying to get Substruct (a rails app) up and running on DreamHost using Passenger. Now when I used WEBrick everything works just like it
should. However (as has been documented before), DreamHost doesn’t
like WEBrick and so I’m trying to use mod_rails (Passenger) instead.

However, whenever I try and access Substruct, Passenger gives me the
following error:

"A source file that the application requires, is missing.

  • It is possible that you didn’t upload your application files
    correctly. Please check whether all your application files are
    uploaded.
  • A required library may not installed. Please install all
    libraries that this application requires.

Further information about the error may have been written to the
application’s log file. Please check it in order to analyse the
problem.

Error message:
Could not find RubyGem fastercsv (>= 0)
Exception class:
Gem::LoadError"

A couple of notes:

  1. I’ve installed all the gems (including fastercsv) in my local
    directory and modified the GEM_PATH to match in my .bash_profile
  2. I’ve trying adding a line in my environment.rb file similar to:
    ENV[‘GEM_PATH’] = ‘/home//.gems:/usr/lib/ruby/gems/1.8’
  3. I’ve tried unpacking the gem into my vendor/ directory

Nothing has really worked so far. If anyone has any ideas it would be
greatly appreciated.

-Willie


#2

I got it working tonight. I’m not quite sure what happened, but I
think it might have been where I was setting the GEM_PATH inside
environment.rb


#3

It was indeed the location in the environment.rb file that matters.

You need to set the GEM_PATH before the rails boostrap:

Specifies gem version of Rails to use when vendor/rails is not present

RAILS_GEM_VERSION = ‘2.3.5’ unless defined? RAILS_GEM_VERSION

if ENV[‘RAILS_ENV’] == ‘production’ # don’t bother on dev
ENV[‘GEM_PATH’] = ENV[‘HOME’] + ‘/.gems’ + ':/usr/lib/ruby/gems/1.8’
end

Bootstrap the Rails environment, frameworks, and default configuration

require File.join(File.dirname(FILE), ‘boot’)

Goodness did I waste a lot of time hung on this one!