Rails on plesk+apache2+fcgid

Hi,

I am try to get RoR running with ruby 1.8.4, Rails 1.1.6, mod_fcgid
1.09, Apache 2, on CentOS 4.3.

When I browser to http://www.mydomain.com/test/ (definately with end
slash) I get an application error. In the apache.log it says that
dispatch.fcgi has ended prematurely, and in the development.log I get:

#-------------------- development.log

Recognition failed for “”^M
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:522:in
recognition_failed'^M /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/routing.rb:512:inrecognize!’^M
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
dispatch'^M /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:inprocess_request’^M
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in
process!'^M /usr/local/lib/ruby/gems/1.8/gems/fcgi-0.8.7/lib/fcgi.rb:606:ineach_cgi’^M
/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in
process!'^M /usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:inprocess!’^M
public/dispatch.fcgi:24

dispatch.fcgi has the corrent path to ruby. And it seems to be running
but it is not getting the “test” directive.

Any ideas? Thanks for your time.
David

Other files

#--------------- vhost.conf

SetEnv RAILS_ENV development
DocumentRoot /var/www/rails/app/public/
ErrorLog /var/www/rails/app/log/apache.log

<Directory /var/www/rails/app/public/>
Options ExecCGI FollowSymLinks
AddHandler fcgid-script .fcgi
AllowOverride all
Order allow,deny
Allow from all

#------------- uncommented lines in .htaccess

AddHandler fcgid-script .fcgi
Options +FollowSymLinks +ExecCGI

RewriteEngine On

RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

ErrorDocument 500 “

Application error

Rails application failed to
start properly”

---- END

hello

i am using the same exact setup for one of my rails app (sprinj.com)
about the fcgi ending prematurely, i added these lines in dispatch.fcgi

require ‘fcgi_handler’
class RailsFCGIHandler
private
def frao_handler(signal)
dispatcher_log :info, “asked to terminate immediately”
dispatcher_log :info, “frao handler will be restarted”
restart_handler(signal)
end
alias_method :exit_now_handler, :frao_handler
end
RailsFCGIHandler.process!

now whenever it stops, it restarts automatically.

also i dont know why you have SetEnv RAILS_ENV development in
vhost.conf,
shouldn t that be in environement.rb?


Heri R.
http://sprinj.com

Thanks Heri,

I think the recognition error is causing the script to end early. Do you
have any ideas on the recognition error.

Cheers, D

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs