nginx problem "We're sorry, but something went wrong."

I try to create a production server and follow the instructions in this document https://github.com/jnstq/rails-nginx-passenger-ubuntu

However, my Rails Application can not work properly, and I get a error message, “We’re sorry, but something went wrong.”.

If I browse my application’s home page, it works.

If I stop nginx server and use WEBrick instead, it works fine.

Following is my /opt/nginx/conf/nginx.conf

http://dl.dropbox.com/u/77217614/Rails%20101%20Install%20Production%20Server%20Question/nginx.conf

I use Virtualbox 4.1.12 to create the production server Host OS is Mac OS X 10.7.3 Guest OS is Ubuntu 8.04 Server http://releases.ubuntu.com/hardy/ubuntu-8.04.4-server-i386.iso

Here is my Virtualbox Image, http://dl.dropbox.com/u/77217614/Rails%20101%20Install%20Production%20Server%20Question/rails_server.ova

username: rubyonrailsserver password: rubyonrailsserver

Following are my instructions to install the production server

01 install ubuntu server

02 echo “alias ll=‘ls -l’” >> ~/.bash_aliases

03 edit .bashrc and uncomment the loading of .bash_aliases

04 sudo apt-get update sudo apt-get upgrade

05 sudo dpkg-reconfigure tzdata

06 sudo apt-get install ntp

07 sudo ntpdate ntp.ubuntu.com # Update time

08 sudo hostname your-hostname

09 Add 127.0.0.1 your-hostname sudo vim /etc/hosts

10 Write your-hostname in sudo vim /etc/hostname

11 sudo apt-get install mysql-server libmysqlclient15-dev

12 Gemrc Add the following lines to ~/.gemrc, this will speed up gem installation and prevent rdoc and ri from being generated, this is not nessesary in the production environment.

Hey Vincent

Your logs would contain a stack trace of what exactly the error was. Could you send that?

Started GET “/posts” for 192.168.1.5 at Thu May 03 17:59:14 +0800 2012

Processing by PostsController#index as HTML

Rendered posts/index.html.erb within layouts/application (0.3ms)

Completed 500 Internal Server Error in 2ms

ActionView::Template::Error (application.css isn’t precompiled):

2:

3:

4: Testapp

5: <%= stylesheet_link_tag “application”, :media => “all” %>

6: <%= javascript_include_tag “application” %>

7: <%= csrf_meta_tags %>

8:

app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__186315690_75549250’

app/controllers/posts_controller.rb:7:in `index’

Hi Aziz,

Many thanks for the advice, above is the error in my log, and I found a solution, http://stackoverflow.com/questions/7275636/rails-3-1-0-actionviewtemplateerrror-application-css-isnt-precompiled

You will get better performance in production if you set config.assets.compile to false in production.rb and precompile your assets. You can precompile with this rake task:

bundle exec rake assets:precompile

If you are using Capistrano, version 2.8.0 has a recipe to handle this at deploy time. For more info, see the “In Production” section of the Asset Pipeline Guide: http://guides.rubyonrails.org/asset_pipeline.html