简体   繁体   中英

Deploying Rails to Amazon EC2 - We're sorry, but something went wrong

I've been following the rails cast to deploy my application to amazon ec2 and I'm having some problems. It took me a while, but i got a test "blog" application deployed successfully yesterday using rubber and it's create_staging method. I am now trying to deploy my actual app but have run into some difficulties. The rubber command finishes, but when I try to access the website through the browser, I get the standard "We're sorry, but something went wrong error".

Look at the log files I hear you say, but when I log into the server through SSH as the ubuntu user and type ls nothing is returned - like there are no files on the server, when I know there are?

Any help really appreciated!

Connecting to database specified by database.yml
Started GET "/login" for 77.100.120.24 at 2013-02-11 07:28:18 -0500
Processing by AccessController#login as HTML
  Rendered access/login.html.erb within layouts/admin (17.8ms)
Completed 500 Internal Server Error in 1082ms

ActionView::Template::Error (stylesheet.css isn't precompiled):
    4: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    5: <title>QLess - <%= @page_title || "Quick Drinks Ordering" %></title>
    6: <%= stylesheet_link_tag    "application", :media => "all" %>
    7: <%= stylesheet_link_tag    "stylesheet", :media => "all" %>
    8: <%= stylesheet_link_tag    "large_screen", :media => "all" %>
    9: <%= javascript_include_tag "application" %>
    10: <%= csrf_meta_tags %>
  app/views/layouts/admin.html.erb:7:in `_app_views_layouts_admin_html_erb__2871469925121006882_32798020'

login to your server through ssh, then cd to application path and then run cat log/production.log or tail -f log/production.log if you're running app in production mode. Else use environment name instead of "production"

Upd: If you have other manifests or individual stylesheets and JavaScript files to include, you can add them to the precompile array:

config.assets.precompile += ['admin.js', 'admin.css', 'swfObject.js']

from here: http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM