2016-08-25 125 views
0

我在部署一個新手,資產預編譯Capistrano的3.4

使用Capistrano的3.4用於預編譯

desc "assets precompile" 
    task :precompile do 
    on roles(:rails) do 
     execute "cd #{release_path} && bundle exec rake assets:precompile RAILS_ENV=#{fetch(:stage)} " 
    end 
    end 
    after :publishing, :precompile 

但預編譯部署

我試圖部署臨時環境,使用此任務越來越凍結不移動,如果我取消註釋上述任務和部署然後它被部署但資產不加載。

請幫助如何進行

回答

1

無需編寫手動任務進行資產precomplie.There是爲它提供不錯的寶石。

在Gemfile中包含gem 'capistrano-rails'

並在capfile中添加require 'capistrano/rails/assets'。

謝謝.. !!