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:

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

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 16 Mar '12, 21:39

ckooiker's gravatar image

ckooiker
55
accept rate: 0%


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.

link

answered 16 Mar '12, 23:00

johns's gravatar image

johns ♦♦
4.1k28
accept rate: 23%

edited 16 Mar '12, 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.

(16 Mar '12, 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.

(17 Mar '12, 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.

(17 Mar '12, 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).

(17 Mar '12, 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?

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

Yes, I believe so.

(17 Mar '12, 11:42) todork todork's gravatar image
showing 5 of 6 show 1 more comments
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:

×92
×71
×27

Asked: 16 Mar '12, 21:39

Seen: 1,341 times

Last updated: 17 Mar '12, 11:44

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