Forum: Ruby on Rails Problems deploying in Dreamhost

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Carlos R. (Guest)
on 2006-02-14 01:39
I am trying to deploy a Rails application on Dreamhost.  My application
works just fine in my laptop using WEBrick.  The problem that I have is
that I currently have  my website in the public folder.  I can reference
everything just fine from if it is in the public folder, but if I click
in a link that is an actual controller/action I get an error that the
file does not exist.  I followed all the instructions stated in the
Dreamhost/Ruby/Rails Wiki.  The way I am referencing the controller from
the index.html is like so:

<p><a href="/customer/submit" >Contact</a></p>


this is (of course) what I get:

File not found

Change this error message for pages not found in public/404.html


Thanks a lot for your help.

Carlos R.
Francois B. (Guest)
on 2006-02-14 01:44
(Received via mailing list)
Hi !

2006/2/13, Carlos R. <removed_email_address@domain.invalid>:
> <p><a href="/customer/submit" >Contact</a></p>
>
> this is (of course) what I get:
>
> File not found
>
> Change this error message for pages not found in public/404.html

Have you changed .htaccess ?  Or dispatch.fcgi ?  Both of these must
exist and have the right permissions for things to work correctly.

You can also try to run dispatch.fcgi from the command line to see if
it reports any errors.

Hope that helps !
Carlos R. (Guest)
on 2006-02-14 01:58
Francois B. wrote:
> Hi !
>
> 2006/2/13, Carlos R. <removed_email_address@domain.invalid>:
>> <p><a href="/customer/submit" >Contact</a></p>
>>
>> this is (of course) what I get:
>>
>> File not found
>>
>> Change this error message for pages not found in public/404.html
>
> Have you changed .htaccess ?  Or dispatch.fcgi ?  Both of these must
> exist and have the right permissions for things to work correctly.
>
> You can also try to run dispatch.fcgi from the command line to see if
> it reports any errors.
>
> Hope that helps !

The contents of my dispatch.fcgi:

require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

class MyRailsFCGIHandler < RailsFCGIHandler
SIGNALS = {
'TERM' => :exit_now,
}

def exit_now_handler(signal)
dispatcher_log :info, "ignoring request to terminate immediately"
end
end

MyRailsFCGIHandler.process! nil, 50

The contents of my .htaccess

AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
RewriteEngine On

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

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

One thing that I did after you mentioned is to run the dispatch.fcgi and
I get the following error:

[hoover]$ ./dispatch.fcgi
Status: 500 Internal Server Error
[hoover]$

I wonder if it is one of the tab issues, but I al ready ran the dos2unix
script on those two files(I also changed the permission to 755)

Thanks a LOT.
James A. (Guest)
on 2006-02-14 03:45
(Received via mailing list)
Have you also changed the #! line at the top of your dispatched to
point to a valid ruby on Dreamhost's servers? (#!/usr/bin/ruby1.8 I
think)...

james

On 2/13/06, Carlos R. <removed_email_address@domain.invalid> wrote:
> >> Change this error message for pages not found in public/404.html
>
> end
>
>
>
>
>
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
* J *
  ~
Carlos R. (Guest)
on 2006-02-14 04:19
James A. wrote:
> Have you also changed the #! line at the top of your dispatched to


I had already.  The logfile from the dispatch.fcgi is not giving me any
clues either.
This topic is locked and can not be replied to.