Forum: Ruby on Rails 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 07:07
What pain.  I am ready to switch hosts.  I have this app in Dreamhost
where I load the static pages just fine.  The location of my rails app
is /home/username/webaddress.com  Under that resides the app/, public/
and so on.  Like I said I can see my static pages that I have under
public since I have in the Managed host panel the following:

Web Directory: /home/username/[ webaddress.com/public ] /

The problem comes in my index.html where I make a reference to

app/controller/customer#submit

in the html by

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


which gives me a file not found/400 error.  I have already checked all
the files as far as permission (done a recursive chmod 755 on app/) and
the shebang.  So about the only thing I can think of is that my
.htaccess is not correct.  Here is 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"


All these stuff worked just fine in WEBrick.

Thanks for your help.
Franck (Guest)
on 2006-02-14 08:57
(Received via mailing list)
Hi Carlos,

I ran into the same issue few weeks ago. WEBrick was working just fine
but
not apache/fcgi.

By default, Dreamhost run your app in production mode whereas in WEBrick
you're in development mode. I hadn't set any production database so I
couldn't work properly.

Could be the same for you.

Franck
Douglas T. (Guest)
on 2006-02-14 11:36
(Received via mailing list)
How about posting the errors in logs/production.log? That should provide
more information
Carlos R. (Guest)
on 2006-02-14 15:43
Franck wrote:
> Hi Carlos,
>
> I ran into the same issue few weeks ago. WEBrick was working just fine
> but
> not apache/fcgi.
>
> By default, Dreamhost run your app in production mode whereas in WEBrick
> you're in development mode. I hadn't set any production database so I
> couldn't work properly.
>
> Could be the same for you.
>
> Franck

If I have the following in my environment.rb it should do it right?

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

As far as the production.log everytime I try to access the app I get the
following(for some reason "customer" is truncated and only showing
"stomer", do not know if this is right ):



Processing Base#index (for 66.249.72.242 at 2006-02-14 02:43:39) [GET]
  Parameters: {}


ActionController::RoutingError (Recognition failed for "stomer/submit"):
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:469:in
`recognition_failed'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:459:in
`recognize!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:in
`process_request'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in
`process!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`each_cgi'
    /usr/lib/ruby/1.8/fcgi.rb:597:in `each'
    /usr/lib/ruby/1.8/fcgi.rb:597:in `each_cgi'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:52:in
`process!'
    /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:22:in
`process!'
    dispatch.fcgi:34
Carlos R. (Guest)
on 2006-02-15 00:03
Any idea on what could be going wrong with this?
Tom W. (Guest)
on 2006-02-15 00:42
(Received via mailing list)
Carlos,

Did you check the DreamHost wiki:

http://wiki.dreamhost.com/index.php/Ruby_on_Rails

There's a lot of good info there. Also, you might try the forums:

http://discussion.dreamhost.com/postlist.pl?Cat=&B...

-Tom
Guest (Guest)
on 2006-02-15 04:22
Yeah I followed the instructions on the WIKI, but no results.
Tom W. wrote:
> Carlos,
>
> Did you check the DreamHost wiki:
>
> http://wiki.dreamhost.com/index.php/Ruby_on_Rails
>
> There's a lot of good info there. Also, you might try the forums:
>
> http://discussion.dreamhost.com/postlist.pl?Cat=&B...
>
> -Tom
Carlos R. (Guest)
on 2006-02-15 05:18
Could anybody tell me if this is an issue with my htacccess or just my
html file?
This thing is a nightmare.  Easy to develop, but damn I inding it harder
than deploying a j2ee app!

Guest wrote:
> Yeah I followed the instructions on the WIKI, but no results.
> Tom W. wrote:
>> Carlos,
>>
>> Did you check the DreamHost wiki:
>>
>> http://wiki.dreamhost.com/index.php/Ruby_on_Rails
>>
>> There's a lot of good info there. Also, you might try the forums:
>>
>> http://discussion.dreamhost.com/postlist.pl?Cat=&B...
>>
>> -Tom
Douglas T. (Guest)
on 2006-02-15 05:32
(Received via mailing list)
is the issue affecting only for this particular url?
gismo (Guest)
on 2006-02-15 05:44
did you try to change your config/routes.rb for redirecting to
customer/submit?
This topic is locked and can not be replied to.