Capistrano部署:资产:预编译在rails 5上失败

时间:2017-06-07 04:46:58

标签: ruby-on-rails capistrano

我在运行此任务时遇到错误: 任务:TOP =>部署:资产:预编译

Error:
The deploy has failed with an error: Exception while executing as deployer@**.**.**.***: rake exit status: 1

这是我的Capfile:

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/nginx'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
require 'capistrano/rvm'
require 'capistrano/rails'
require 'capistrano/rails/db'
require 'capistrano/rails/console'
require 'capistrano/upload-config'
require 'sshkit/sudo'

Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

这个capfile在Rails 4上运行。我在迁移到rails 5时遇到了错误。

1 个答案:

答案 0 :(得分:0)

这解决了我的错误:我的capfile现在看起来像这个

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/nginx'
require 'capistrano/puma'
require 'capistrano/puma/nginx'
require 'capistrano/rvm'
require 'capistrano/rails/migrations'
require 'capistrano/rails/db'
require 'capistrano/rails/console'
require 'capistrano/upload-config'
require 'sshkit/sudo'

Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } 

我删除了这一行以进行资产编译

 require 'capistrano/rails 

并替换为

 require 'capistrano/rails/migrations