I've recently deployed a Rails 3.2 app, using Capistrano, to a new nginx instance up on web108, following most of the instructions here: http://docs.webfaction.com/software/rails.html#deploying-a-ruby-on-rails-application-with-capistrano

I've also removed the helloworld starter app and updated the nginx.conf to look like this:


*env               GEM_HOME=/home/webfaction_user/webapps/site_application/gems;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    access_log  /home/webfaction_user/logs/user/access_site_application.log  combined;
    error_log   /home/webfaction_user/logs/user/error_site_application.log   crit;

    include         mime.types;
    passenger_root  /home/webfaction_user/webapps/site_application/gems/gems/passenger-3.0.11;
    passenger_ruby  /home/webfaction_user/webapps/site_application/bin/ruby;
    sendfile        on;

    passenger_max_instances_per_app  1;
    rails_spawn_method               conservative;
    passenger_max_pool_size 2;

    server {
        listen             28945;
        passenger_enabled  on;
        root               /home/username/webapps/railsapp/current/public;
        server_name        localhost;
        rails_env          production;
    }
}*

The app deploys no problem, and looking at the logs, error free. I've setup a website through the control panel that uses one of my subdomains and the site app containing my deployed RoR app (dir: user/webapps/site_app/deployedrailsapp), URL path is '/'. However, the set up website is displaying a 404.

I originally had root :to=> "pages#home" setup in routes.rb, but commented it out in order to route to the default index.html root file in the public folder, but am still getting the same error.

The root of my subdomain displayed the Rails welcome page for the starter helloworld app; should that same location now display index.html for my deployed app? Has anyone run into this before?

Let me know if you want to see my deploy.rb.

asked 10 Apr '12, 23:38

chrisklein's gravatar image

chrisklein
33
accept rate: 0%

edited 11 Apr '12, 11:24

Are you sure that:

/home/username/webapps/railsapp/current/public;

exists?

Also, have you looked at your logs at: /home/webfaction_user/logs/user/error_site_application.log

and seen the error in detail?

(11 Apr '12, 03:13) neeravk neeravk's gravatar image

Yeah, just double-checked. That directory definitely exists. I also checked the error_site_application.log and no errors.

(11 Apr '12, 09:45) chrisklein chrisklein's gravatar image

Hi,

Can you make sure that "passenger_root" and "passenger_root" exist as well?

(11 Apr '12, 10:21) todork todork's gravatar image

Yeah,

The passernger-3.0.11 gem is there.

bin/ruby is pointing at /usr/local/bin/ruby1.9

(11 Apr '12, 11:01) chrisklein chrisklein's gravatar image

I just had a look at your actual nginx.conf and I see that your server root is actually set to "/home/username/webapps/railsapp/current/public" (literally).

Try changing that to your actual user name and app name, restart your Nginx, and you should be good to go (barring any other errors).

link

answered 11 Apr '12, 15:03

seanf's gravatar image

seanf ♦♦
8.0k1726
accept rate: 39%

Yep, that was it. I don't know how I missed it. Thanks!

(11 Apr '12, 20:55) chrisklein chrisklein's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×157
×92
×19
×19

Asked: 10 Apr '12, 23:38

Seen: 1,427 times

Last updated: 11 Apr '12, 20:55

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited