环境:
ruby 2.5.3 rails 5.2.3
问题:
使用 mina 部署,添加 puma 和 sidekiq,就会提示 Could not locate Gemfile or .bundle/ directory 错误,如果去除 puma 和 sidekiq 的语句,就能执行成功
desc "Deploys the current version to the server."
task :deploy do
deploy do
#invoke :'sidekiq:quiet'
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install'
invoke :'rails:db_migrate'
invoke :'deploy:cleanup'
command 'npm install'
command 'npm run prod-assets'
on :launch do
in_path(fetch(:current_path)) do
#invoke :'sidekiq:restart'
#invoke :'puma:stop'
#invoke :'puma:start'
command "rm -rf #{fetch(:deploy_to)}/current/node_modules"
command %{mkdir -p tmp/}
command %{touch tmp/restart.txt}
end
end
end
end