Rails的500错误:application.css不是precompiled [英] Rails 500 Error: application.css isn't precompiled

查看:115
本文介绍了Rails的500错误:application.css不是precompiled的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经得到的Rails从MEDIATEMPLE(VE)服务器。我的应用程序是给我一个500错误(Rails的错误,而不是Apache的错误),当我尝试加载任何页面:的http:/ /www.mvngmtns.com

I've got Rails running on Passenger with Apache on an Ubuntu linux box (ve) Server from Mediatemple. My app is giving me a 500 error (a Rails error, not an Apache error) when I try to load any page: http://www.mvngmtns.com

我看到一篇文章有​​关更改配置/环境/ production.rb这一行:

I saw an article about changing this line in config/environments/production.rb:

    config.assets.compile = true

但这并没有解决我的问题。谁能帮助?

But this didn't solve my problem. Can anyone help?

我development.log:

My development.log:

Started GET "/" for 72.225.170.239 at 2012-06-29 15:28:43 -0700
Processing by HomeController#index as HTML
Rendered application/_logo.html.erb (0.6ms)
Rendered application/_navbar.html.erb (1.4ms)
Rendered home/index.html.erb within layouts/application (2.6ms)
Completed 500 Internal Server Error in 6ms

ActionView::Template::Error (application.css isn't precompiled):
2: <html>
3: <head>
4:   <title>Moving Mountains<%= get_title %></title>
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___2841110860658336572_129641540'
app/controllers/home_controller.rb:6:in `index'

根据要求,跑

    rake assets:precompile --trace RAILS_ENV=production
    touch /tmp/restart.txt

但仍是同样的错误。这里的踪迹说什么:

but still the same error. Here's what the trace said:

newguy@mvngmtns:/var/www/movingmountains$ rake assets:precompile --trace RAILS_ENV=production
** Invoke assets:precompile (first_time)
** Execute assets:precompile
/usr/local/rvm/rubies/ruby-1.9.2-head/bin/ruby /usr/local/rvm/gems/ruby-1.9.2-head@global/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace
** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
** Invoke assets:precompile:nondigest (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:non digest

我仍然有同样的500 - 很抱歉,但出事了,在浏览器和高速缓存:GET /]怀念在Apache日志文件

I still have the same "500 - We're sorry, but something went wrong" in the browser, and cache: [GET /] miss in the apache log file.

推荐答案

设置完成后

config.assets.compile = true

您还应该运行:

 rake assets:precompile --trace RAILS_ENV=production

请参阅:<一href=\"http://stackoverflow.com/questions/7275636/rails-3-1-0-actionviewtemplateerrror-application-css-isnt-$p$pcompiled\">rails 3.1.0 ::的ActionView ::模板Errror(application.css不是precompiled)

这篇关于Rails的500错误:application.css不是precompiled的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆