login community faq

Hopefully someone can help me with this.

I created a new RoR app through the control panel. Then followed the instructions to install the sqlLite ruby gem from source I then followed the "Deploying a Ruby on Rails Application" guide to deploy my own app.

After deploying my own app I ran bundle install and it ran without error.

It is a very basic RoR app it has one controller called static_pages and two views called home and about to go with it.

the routes.rb has this:

1
2
get "static_pages/home"  
get "static_pages/about"

Now when I got to my site: http://username.webfactional.com/static_pages/home and I get an Internal Server Error (500)

Here is what is in the nginx error.log

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
cache: [GET /assets/rails.png] miss
cache: [GET /static_pages/home] miss
cache: [GET /static_pages/home/] miss
cache: [GET /assets/rails.png] miss
2012/03/16 21:17:01 [emerg] 19415#0: bind() to 0.0.0.0:17813 failed (98: Address already in use)
2012/03/16 21:17:01 [emerg] 19415#0: bind() to 0.0.0.0:17813 failed (98: Address already in use)
2012/03/16 21:17:01 [emerg] 19415#0: bind() to 0.0.0.0:17813 failed (98: Address already in use)
2012/03/16 21:17:01 [emerg] 19415#0: bind() to 0.0.0.0:17813 failed (98: Address already in use)
2012/03/16 21:17:01 [emerg] 19415#0: bind() to 0.0.0.0:17813 failed (98: Address already in use)
2012/03/16 21:17:01 [emerg] 19415#0: still could not bind()
cache: [GET /static_pages/home] miss
cache: [GET /static_pages/home] miss

Since I'm still very new to RoR, I have no idea what is causing the problem especially since this very basic.

Any help would be greatly appreciated

Regards,
Chris

asked Mar 16 '12 at 21:39

ckooiker's gravatar image

ckooiker
53


It looks like another instance of nginx is running. Have you tried restarting the nginx server after making your changes? You might also want to enable development to get more info from RoR.

answered Mar 16 '12 at 23:00

johns's gravatar image

johns ♦♦
340427

edited Mar 16 '12 at 23:00

Thanks for your reply johns. When I switched into development mode it complained about not being able to find the JavaScript runtime. After installing the execjs and therubyracer gems the issues went away, and I could properly view my 2 static pages. But after turning off the development mode I still get the same 500 error as before.

(Mar 16 '12 at 23:51) ckooiker ckooiker's gravatar image

Do you have different database settings/drivers for production vs development? Are there any other factors between the configuration files that differs? Trying to isolate what is different between the 2 configurations would be the next step.

(Mar 17 '12 at 01:45) johns ♦♦ johns's gravatar image

No the database settings are same. In my production.rb I set this line: config.consider_all_requests_local = true. This turns on the full error reports after restarting I got this error:application.css isn't precompiled. So I set config.assets.compile = true which solved the issue.

(Mar 17 '12 at 10:39) ckooiker ckooiker's gravatar image

Hi,

You might also want to run "bundle exec rake assets:precompile RAILS_ENV=production" so assets are precompiled instead of being compiled live (on demand).

(Mar 17 '12 at 11:24) todork todork's gravatar image

Yes I did that and after doing that I set the config.assets.compile back to false. Thanks!

So I'm assuming that every time I add a new asset (js, img, css) I should be running the precompile command correct?

(Mar 17 '12 at 11:40) ckooiker ckooiker's gravatar image

Yes, I believe so.

(Mar 17 '12 at 11:42) todork todork's gravatar image
showing 5 of 6 show all
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

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