簡體   English   中英

耙資產:預編譯無法在本地編譯

[英]rake assets:precompile does not work compiling locally

我只是在我的質量檢查和生產服務器上運行了它,它運行得非常完美。

rake assets:precompile

但是當我在本地運行它時,跟蹤響應良好。 我可以確定由於我的.scss.erb文件正在訪問數據庫。 事情發生了 ,但是當我重新啟動服務器並檢查css文件時,實際上沒有進行任何更改。

補充筆記 :

我的application.rb具有->

config.assets.initialize_on_precompile = true

colors.scss.erb的內容

<% Color.for_header.each do |color| %>
#super_header.color-<%= color.id %>, #eheader.color-<%= color.id %> {
  background-color: #<%= color.code %>;
  background-image: none;
}
<% end %>

<% Color.for_highlight.each do |color| %>
.lists-list.color-<%= color.id %> li {
  &.current a {
    &:before { background: url(/images/group-select-end-left/<%= color.image %>) no-repeat !important; }
    &:after  { background: url(/images/group-select-end-right/<%= color.image %>) no-repeat !important;}    
  }
  &.active, &.current {
    a {
      background-color: #<%= color.code %> !important;
      background-image: none !important;
    }
    &:before {
      background: url(/images/group-select-end-left/<%= color.image %>) no-repeat !important;
      left: -9px;
      height: 39px;
      width: 9px;      
    }
    &:after {
      background: url(/images/group-select-end-right/<%= color.image %>) no-repeat;
      right: -10px;
      width: 10px;
      height: 30px;
      top: 0;
    }
  }
}
<% end %>

由於rake加載了所有的Rails堆棧,因此您可能需要添加環境:

RAILS_ENV=your_env_name bundle exec rake assets:precompile

它使用capistrano在我的登台服務器(不是heroku )上工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM