Welcome Guest | Login

Content of dispatch.fcgi displayed online after deployemnt

Hi,

I followed the tutorial for deploying my application but I have a problem: the content of dispatch.fcgi is being displayed?????

("AddHandler fastcgi-script .fcgi" is commented out and "host: localhost" is present)
(also, when I tried  "killall -usr1 dispatch.fcgi" I got:

dispatch.fcgi(32587): Operation not permitted
...
dispatch.fcgi(735): Operation not permitted
dispatch.fcgi: no process killed
?????)



Follows my files:



database.yml:

# And be sure to use new-style password hashing:

#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html

development:

 adapter: mysql

 database: proximicity_development

 username: root

 password:

 host: localhost

 encoding: utf8

============================================

my .htaccess:


# General Apache options

AddHandler fastcgi-script .fcgi

#AddHandler cgi-script .cgi

Options +FollowSymLinks +ExecCGI



# If you don't want Rails to look in certain directories,

# use the following rewrite rules so that Apache won't rewrite certain requests

#

# Example:

#   RewriteCond %{REQUEST_URI} ^/notrails.*

#   RewriteRule .* - [L]



# Redirect all requests not available on the filesystem to Rails

# By default the cgi dispatcher is used which is very slow

#

# For better performance replace the dispatcher with the fastcgi one

#

# Example:

#   RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

RewriteEngine On



# If your Rails application is accessed via an Alias directive,

# then you MUST also set the RewriteBase in this htaccess file.

#

# Example:

#   Alias /myrailsapp /path/to/myrailsapp/public

#   RewriteBase /myrailsapp



RewriteRule ^$ index.html [QSA]

RewriteRule ^([^.]+)$ $1.html [QSA]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]



# In case Rails experiences terminal errors

# Instead of displaying this message you can supply a file here which will be rendered instead

#

# Example:

#   ErrorDocument 500 /500.html



ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"

==========================================

My environment.rb:


# Be sure to restart your web server when you modify this file.



# Uncomment below to force Rails into production mode when

# you don't control web/app server and can't set it the proper way

ENV['RAILS_ENV'] ||= 'production'



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

RAILS_GEM_VERSION = '1.2.1' unless defined? RAILS_GEM_VERSION



# Bootstrap the Rails environment, frameworks, and default configuration

require File.join(File.dirname(__FILE__), 'boot')

======================

Thank you for your help,

2008-03-20 09:27 AM

I ran dispatch.fcgi from command line...and it gave me the following logs..

]$ ./dispatch.fcgi
Missing the Rails 1.2.1 gem. Please `gem install -v=1.2.1 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

Also note that we don't have this rails version installed on our server. I am pasting the available rails versions below..

rails (2.0.2, 2.0.1, 1.2.6, 1.2.5, 1.2.3, 1.2.2)

You can either upgrade the rails version of your application to the ones available on the server or install the required rails gem in your home directory and freeze the same..Please use the following link to achieve the same..

www.hostingrails.com/forums/wiki_thread/2

2008-03-20 10:03 AM

Regards,
Rahul
Hi Rahul,

Thank you for your reply.
I tried to download rails v1.2.1 using this command: `gem install -v=1.2.1 rails` but rails v2.0.2 got downloaded instead??

I tried to use version 1.2.2 (updating environment.rb) instead but I am now getting a 500 error (same thing happens when I comment out RAILS_GEM_VERSION).

Am I right to believe it is likely my application will still work ok with v1.2.2?

Thank you for your help,

2008-03-20 11:04 AM

Hello,

I got the following errors in the production logs while accessing the URL related with your rails application..
=
Expected ./../config/../app/controllers/pages_controller.rb to define PagesController
=

Can you check the codes of your app again..and make sure that they are set properly..

2008-03-20 11:39 AM

Regards,
Rahul
Hi,

The codes in my application are working fine in development...
I have a doubt regarding the routes.rb file though:

[     Ok first, if you haven't already done so, in your routes.rb set the root route to the name of your main controller (you will see that all you need to do is uncomment the following line and add in your controller name):

map.connect '', :controller => "your_main_controller_name"]

I have put:

 map.connect '', :controller => 'pages',
                :action => 'show',
                :id => '1-welcome-page'

Could this be causing the problem???

Also ./dispatch.fcgi is giving a serie of errors like these:

$ ./dispatch.fcgi
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_support/dependencies.rb:488:in `load': ./../config/../config/routes.rb:18: syntax error, unexpected tIDENTIFIER, expecting kEND (SyntaxError)
 map.connect ':controller => 'pages',
                                   ^
./../config/../config/routes.rb:19: syntax error, unexpected tIDENTIFIER, expecting kEND
                :action => 'show',
                                ^
./../config/../config/routes.rb:20: syntax error, unexpected tINTEGER, expecting kEND
                :id => '1-welcome-page'
                         ^
./../config/../config/routes.rb:20: syntax error, unexpected tSTRING_BEG, expecting kDO or '{' or '('
Strangely enough, when in the route.rb I replace single quotes with double quotes ./dispatch.fcgi does not produce the error message above? But I am still getting the 500 error??????????

[replacing:
map.connect '', :controller => 'pages',
               :action => 'show',
               :id => '1-welcome-page'

with
map.connect '', :controller => "pages",
               :action => "show",
               :id => "1-welcome-page"
for the whole routes.rb file]

2008-03-20 11:51 AM

Hi joseph,
We use map.connect in the routes.rb to make that page to come by default, if you want to display a particular page without giving the controller name in the browser you can do like this.

I think the id mentioned by you has some problem, You just try with any numerical value as ID and try.

eg:- map.connect '', :controller => 'pages',
               :action => 'show',
               :id => '1'

2008-03-20 04:23 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.