部署 使用 Mina 部署,添加 Puma 或者 Sidekiq,就会提示 Could not locate Gemfile or .bundle/ directory 错误

stephen · June 18, 2019 · Last by rails_taotao replied at June 20, 2019 · 7185 hits

环境:

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

1 Floor has deleted

首先需要 gem ' mina-sidekiq',再你的 deploy.rb 文件下需要 require 'mina-sidekiq'和 require 'puma'

require 'mina/multistage'
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'  # for rbenv support. (http://rbenv.org)
#require 'mina/rvm'    # for rvm support. (http://rvm.io)
require 'mina/unicorn'
require 'mina/logs'
require 'mina_sidekiq/tasks'

人家是 mina 没 capfile

Reply to gwq

mina 是 delpoy.rb 文件

You need to Sign in before reply, if you don't have an account, please Sign up first.