Deploying in Dreamhost


#1

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

Contact

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 “

Application error

Rails application failed to
start properly”

All these stuff worked just fine in WEBrick.

Thanks for your help.


#2

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


#3

How about posting the errors in logs/production.log? That should provide
more information


#4

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:inrecognize!’
/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:inprocess_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:ineach_cgi’
/usr/lib/ruby/1.8/fcgi.rb:597:in each' /usr/lib/ruby/1.8/fcgi.rb:597:ineach_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:inprocess!’
dispatch.fcgi:34


#5

Any idea on what could be going wrong with this?


#6

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=&Board=forum_programming

-Tom


#7

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=&Board=forum_programming

-Tom


#8

is the issue affecting only for this particular url?


#9

did you try to change your config/routes.rb for redirecting to
customer/submit?


#10

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=&Board=forum_programming

-Tom