使用Passenger在RailsEnv為Production發生錯誤
發表人:
Seachaos
積分: 2432
積分: 2432
如果使用Passenger做為ROR的Server
且RailsEnv為 Production時
可能會遇到以下錯誤
[sea:phpCode]
Processing by IndexController#index as HTML
Rendered index/index.html.erb within layouts/application (0.7ms)
Completed 500 Internal Server Error in 2ms
ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4: <title>OCW</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___935187593_70263650719900'
[/sea]
可以到
config/envirmsnts/production.rb
修改成以下設定
[sea:phpCode]
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
[/sea]
且RailsEnv為 Production時
可能會遇到以下錯誤
[sea:phpCode]
Processing by IndexController#index as HTML
Rendered index/index.html.erb within layouts/application (0.7ms)
Completed 500 Internal Server Error in 2ms
ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4: <title>OCW</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head>
app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb___935187593_70263650719900'
[/sea]
可以到
config/envirmsnts/production.rb
修改成以下設定
[sea:phpCode]
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = true
# Generate digests for assets URLs
config.assets.digest = true
[/sea]