Project

General

Profile

FCGI fail with Apache user, but ok with root oO

Added by Guillaume Fillol over 13 years ago

I'm trying to execute the dispatch.fcgi script in shell (first step before using the apache fcgid mod).

The dispatch.fcgi file :

#!/usr/bin/env ruby1.8

require File.dirname(FILE) + "/../public_html/config/environment"

require 'fcgi_handler'

RailsFCGIHandler.process!

In shell, I can execute succesfully the dispatch.fcgi file as root user.

But as www-data user, it displays the following error message :

./../public_html/config/../vendor/rails/railties/lib/initializer.rb:271:in `require_frameworks': Could not find RubyGem rack (~> 1.0.1) (RuntimeError)

from ./../public_html/config/../vendor/rails/railties/lib/initializer.rb:134:in `process'

from ./../public_html/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'

from ./../public_html/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'

from ./../public_html/config/environment.rb:20

from ./dispatch.fcgi:22:in `require'

from ./dispatch.fcgi:22

Any idea how to make www-data user executes successfully the script ?

OS: Debian 6.0, rubygems1.8, rails 2.3.5, rack 1.0.1


Replies (1)

RE: FCGI fail with Apache user, but ok with root oO - Added by Guillaume Fillol over 13 years ago

I had to give access to /var/lib/gems/1.8 path to everyone and now it works fine :

chmod o+r -R /var/lib/gems/1.8

find /var/lib/gems/1.8 -type d -exec chmod o+x {} \;

    (1-1/1)