【问题标题】:Assets not compailing on development资产未在开发中编译
【发布时间】:2013-06-25 17:51:48
【问题描述】:

我有一个 ROR 应用程序,我正在尝试通过加载资产管道来提高性能。

在我正在调用的布局文件中

= stylesheet_link_tag 'users/application_login', :media => "all"

当我在开发中运行它时,它运行良好

ss
=> Booting Thin
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
=> Debugger enabled
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop

但是当我将它作为生产运行时,它告诉我我的资产没有预编译

RAILS_ENV=production rails server
=> Booting Thin
=> Rails 3.2.11 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
Started GET "/users/sign_in" for 127.0.0.1 at 2013-06-25 13:52:18 -0400
Processing by Users::SessionsController#new as HTML
  Rendered users/sessions/new.html.haml within layouts/login (539.8ms)
Completed 500 Internal Server Error in 860ms
** [Airbrake] Success: Net::HTTPOK

ActionView::Template::Error (users/application_login.css isn't precompiled):

我在跑步

RAILS_ENV=production rake assets:precompile

我在 /public/assets/users/ 上看到了一些文件,但在 application_login.css

上没有看到

我能做什么?

【问题讨论】:

    标签: ruby-on-rails asset-pipeline development-environment


    【解决方案1】:

    在 production.rb 中添加:

    config.assets.precompile += %w( application_login.css )
    

    【讨论】:

    • 你也可以在那里添加任何其他丢失的文件
    猜你喜欢
    • 2012-01-23
    • 2019-11-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-26
    • 1970-01-01
    相关资源
    最近更新 更多