Ruby on rails 卡波斯特拉诺:cap中止了!Don';我不知道如何构建任务';启动';(请参阅带有“cap--tasks”的可用任务列表)

Ruby on rails 卡波斯特拉诺:cap中止了!Don';我不知道如何构建任务';启动';(请参阅带有“cap--tasks”的可用任务列表),ruby-on-rails,puma,rbenv,capistrano3,Ruby On Rails,Puma,Rbenv,Capistrano3,在网上发现了很多关于这个问题的问题,但是我没有找到一个解决我的问题的方法,而且很难完全理解 这是我唯一的问题 我开始用rbenv重写一个RubyonRails应用程序。我想尝试使用CapistranoPuma和Nginx部署此应用程序(我是否还需要乘客,还是只能使用Puma?) 我已经在本地机器上写了我的项目。现在我正在尝试将其部署到服务器中。但是从一开始我就对Capistrano配置有这个问题 怎么了 $ cap --tasks --trace ** Invoke load:defaults

在网上发现了很多关于这个问题的问题,但是我没有找到一个解决我的问题的方法,而且很难完全理解

这是我唯一的问题

我开始用rbenv重写一个RubyonRails应用程序。我想尝试使用CapistranoPumaNginx部署此应用程序(我是否还需要乘客,还是只能使用Puma?)

我已经在本地机器上写了我的项目。现在我正在尝试将其部署到服务器中。但是从一开始我就对Capistrano配置有这个问题

怎么了

$ cap --tasks --trace
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
Don't know how to build task 'start' (See the list of available tasks with `cap --tasks`)
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task_manager.rb:59:in `[]'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task.rb:405:in `[]'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/dsl/task_enhancements.rb:7:in `before'
/home/deploy/ecran-village-plannings/config/deploy.rb:85:in `block in <top (required)>'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/task_manager.rb:232:in `in_namespace'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/dsl_definition.rb:141:in `namespace'
/home/deploy/ecran-village-plannings/config/deploy.rb:76:in `<top (required)>'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/rake_module.rb:29:in `load_rakefile'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/default_loader.rb:11:in `load'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:781:in `load_imports'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/application.rb:105:in `load_imports'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:711:in `raw_load_rakefile'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/application.rb:14:in `run'
/home/deploy/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/bin/cap:3:in `<top (required)>'
/home/deploy/.rbenv/versions/2.7.2/bin/cap:23:in `load'
/home/deploy/.rbenv/versions/2.7.2/bin/cap:23:in `<main>'
Capfile

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.2'

gem 'rails-i18n'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
gem 'bcrypt', '~> 3.1.7'
gem 'sorcery'
# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
# gem "dotenv-rails"

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development, :production do
  #Add Capistrano
  gem 'capistrano'
  gem 'capistrano-rails'
  gem 'capistrano-bundler'
  gem 'capistrano-rbenv' 
  gem 'capistrano3-puma', github: "seuros/capistrano-puma"
  gem 'capistrano-nginx'
  gem 'capistrano-ext'
  
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '~> 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require "capistrano/rails/migrations"
require 'capistrano/rbenv'
require 'capistrano/nginx'
require 'capistrano/puma'
install_plugin Capistrano::Puma
install_plugin Capistrano::Puma::Nginx
# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
# require "capistrano/scm/git"
# install_plugin Capistrano::SCM::Git

# Include tasks from other gems included in your Gemfile
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

#set :rbenv_type, :user
#set :rbenv_ruby, '2.7.2'
config/deploy.rb

# config valid for current version and patch releases of Capistrano
lock "~> 3.14.1"

server 'seances.ecranvillage.ovh', roles: [:web, :app, :db], primary: true

set :repo_url, "git@framagit.org:rodinux/ecran-village-plannings.git"
set :application, "ecran_village_plannings"
ask :branch, 'master'
set :bundle_without, %w{development test}.join(' ')

set user: 'deploy', roles: %w{app db web}
# Default value for :format is :airbrussh.
# set :format, :airbrussh

# You can configure the Airbrussh format using :format_options.
# These are the defaults.
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto

# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
append :linked_files, "config/master.key", "config/database.yml"

# Default value for linked_dirs is []
append :linked_dirs, "bin", "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle" "public/system", "storage"

# Default value for default_env is {}
#set :default_env, { path: "/opt/ruby/bin:$PATH" }
#set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')

# Default value for linked_dirs is []
#set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads' )

# Rbenv specific settings
set :rbenv_path, '/home/deploy/.rbenv/'
set :rbenv_type, :system # or :system, depends on your rbenv setup
set :rbenv_ruby, 'ruby 2.7.2p137'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"

# Default value for local_user is ENV['USER']
# set :local_user, -> { `git config user.name`.chomp }

set :rails_env, 'production'
# Default value for keep_releases is 5
set :keep_releases, 5
# if you want to remove the dump file after loading
set :db_local_clean, true
# if you want to remove the dump file from the server after downloading
set :db_remote_clean, true
# if you are highly paranoid and want to prevent any push operation to the server
set :disallow_pushing, false

# Uncomment the following to require manually verifying the host key before first deploy.
# set :ssh_options, verify_host_key: :secure
set :puma_threads,    [4, 16]
set :puma_workers,    2
set :use_sudo,        false
set :stage,           :production
set :deploy_via,      :remote_cache
set :deploy_to,       "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
set :puma_bind,       "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock"
set :puma_state,      "#{shared_path}/tmp/pids/puma.state"
set :puma_pid,        "#{shared_path}/tmp/pids/puma.pid"
set :puma_access_log, "#{release_path}/log/puma.error.log"
set :puma_error_log,  "#{release_path}/log/puma.access.log"
set :ssh_options,     { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) }

set :nginx_config_name, 'ecran_village_plannings'
set :nginx_server_name, 'seances.ecranvillage.ovh'

set :puma_preload_app, true
set :puma_worker_timeout, nil
set :puma_init_active_record, true  # Change to false when not using ActiveRecord
set :puma_workers, 2

namespace :puma do
  desc 'Create Directories for Puma Pids and Socket'
  task :make_dirs do
    on roles(:app) do
      execute "mkdir #{shared_path}/tmp/sockets -p"
      execute "mkdir #{shared_path}/tmp/pids -p"
    end
  end

  before :start, :make_dirs
end

namespace :deploy do
  desc "Make sure local git is in sync with remote."
  task :check_revision do
    on roles(:app) do
      unless `git rev-parse HEAD` == `git rev-parse origin/master`
        puts "WARNING: HEAD is not the same as origin/master"
        puts "Run `git push` to sync changes."
        exit
      end
    end
  end

  desc 'Initial Deploy'
  task :initial do
    on roles(:app) do
      before 'deploy:restart', 'puma:start'
      invoke 'deploy'
    end
  end

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      invoke 'puma:restart'
    end
  end

  before :starting,     :check_revision
  after  :finishing,    :compile_assets
  after  :finishing,    :cleanup
  after  :finishing,    :restart
end
# when using db, you should add config/database.yml here
# set :linked_files, fetch(:linked_files, []).concat(%w{.rbenv-vars})
# set :linked_dirs, fetch(:linked_dirs, []).concat(%w{log tmp/pids tmp/cache tmp/sockets vendor/bundle})
# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
set :stage, :production # this defines production stage for deployment

set :branch, 'master'
server "seances.ecranvillage.ovh", user: "deploy", roles: %w{app db web}, my_property: :my_value
# server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
# server "db.example.com", user: "deploy", roles: %w{db}




# role-based syntax
# ==================

# Defines a role with one or multiple servers. The primary server in each
# group is considered to be the first unless any hosts have the primary
# property set. Specify the username and a domain or IP for the server.
# Don't use `:all`, it's a meta role.

# role :app, %w{deploy@example.com}, my_property: :my_value
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db,  %w{deploy@example.com}



# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
# These variables are then only loaded and set in this stage.
# For available Capistrano configuration variables see the documentation page.
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.



# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult the Net::SSH documentation.
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
#
# Global options
# --------------
set :ssh_options, {
    keys: %w(/home/deploy/.ssh/id_rsa),
#    forward_agent: false,
#    auth_methods: %w(password)
}
#
# The server-based syntax can be used to override options:
# ------------------------------------
# server "example.com",
#   user: "user_name",
#   roles: %w{web app},
#   ssh_options: {
#     user: "user_name", # overrides user setting above
#     keys: %w(/home/user_name/.ssh/id_rsa),
#     forward_agent: false,
#     auth_methods: %w(publickey password)
#     # password: "please use keys"
#   }
/config/deploy/production.rb

# config valid for current version and patch releases of Capistrano
lock "~> 3.14.1"

server 'seances.ecranvillage.ovh', roles: [:web, :app, :db], primary: true

set :repo_url, "git@framagit.org:rodinux/ecran-village-plannings.git"
set :application, "ecran_village_plannings"
ask :branch, 'master'
set :bundle_without, %w{development test}.join(' ')

set user: 'deploy', roles: %w{app db web}
# Default value for :format is :airbrussh.
# set :format, :airbrussh

# You can configure the Airbrussh format using :format_options.
# These are the defaults.
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto

# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
append :linked_files, "config/master.key", "config/database.yml"

# Default value for linked_dirs is []
append :linked_dirs, "bin", "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle" "public/system", "storage"

# Default value for default_env is {}
#set :default_env, { path: "/opt/ruby/bin:$PATH" }
#set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')

# Default value for linked_dirs is []
#set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads' )

# Rbenv specific settings
set :rbenv_path, '/home/deploy/.rbenv/'
set :rbenv_type, :system # or :system, depends on your rbenv setup
set :rbenv_ruby, 'ruby 2.7.2p137'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"

# Default value for local_user is ENV['USER']
# set :local_user, -> { `git config user.name`.chomp }

set :rails_env, 'production'
# Default value for keep_releases is 5
set :keep_releases, 5
# if you want to remove the dump file after loading
set :db_local_clean, true
# if you want to remove the dump file from the server after downloading
set :db_remote_clean, true
# if you are highly paranoid and want to prevent any push operation to the server
set :disallow_pushing, false

# Uncomment the following to require manually verifying the host key before first deploy.
# set :ssh_options, verify_host_key: :secure
set :puma_threads,    [4, 16]
set :puma_workers,    2
set :use_sudo,        false
set :stage,           :production
set :deploy_via,      :remote_cache
set :deploy_to,       "/home/#{fetch(:user)}/apps/#{fetch(:application)}"
set :puma_bind,       "unix://#{shared_path}/tmp/sockets/#{fetch(:application)}-puma.sock"
set :puma_state,      "#{shared_path}/tmp/pids/puma.state"
set :puma_pid,        "#{shared_path}/tmp/pids/puma.pid"
set :puma_access_log, "#{release_path}/log/puma.error.log"
set :puma_error_log,  "#{release_path}/log/puma.access.log"
set :ssh_options,     { forward_agent: true, user: fetch(:user), keys: %w(~/.ssh/id_rsa.pub) }

set :nginx_config_name, 'ecran_village_plannings'
set :nginx_server_name, 'seances.ecranvillage.ovh'

set :puma_preload_app, true
set :puma_worker_timeout, nil
set :puma_init_active_record, true  # Change to false when not using ActiveRecord
set :puma_workers, 2

namespace :puma do
  desc 'Create Directories for Puma Pids and Socket'
  task :make_dirs do
    on roles(:app) do
      execute "mkdir #{shared_path}/tmp/sockets -p"
      execute "mkdir #{shared_path}/tmp/pids -p"
    end
  end

  before :start, :make_dirs
end

namespace :deploy do
  desc "Make sure local git is in sync with remote."
  task :check_revision do
    on roles(:app) do
      unless `git rev-parse HEAD` == `git rev-parse origin/master`
        puts "WARNING: HEAD is not the same as origin/master"
        puts "Run `git push` to sync changes."
        exit
      end
    end
  end

  desc 'Initial Deploy'
  task :initial do
    on roles(:app) do
      before 'deploy:restart', 'puma:start'
      invoke 'deploy'
    end
  end

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      invoke 'puma:restart'
    end
  end

  before :starting,     :check_revision
  after  :finishing,    :compile_assets
  after  :finishing,    :cleanup
  after  :finishing,    :restart
end
# when using db, you should add config/database.yml here
# set :linked_files, fetch(:linked_files, []).concat(%w{.rbenv-vars})
# set :linked_dirs, fetch(:linked_dirs, []).concat(%w{log tmp/pids tmp/cache tmp/sockets vendor/bundle})
# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
set :stage, :production # this defines production stage for deployment

set :branch, 'master'
server "seances.ecranvillage.ovh", user: "deploy", roles: %w{app db web}, my_property: :my_value
# server "example.com", user: "deploy", roles: %w{app web}, other_property: :other_value
# server "db.example.com", user: "deploy", roles: %w{db}




# role-based syntax
# ==================

# Defines a role with one or multiple servers. The primary server in each
# group is considered to be the first unless any hosts have the primary
# property set. Specify the username and a domain or IP for the server.
# Don't use `:all`, it's a meta role.

# role :app, %w{deploy@example.com}, my_property: :my_value
# role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
# role :db,  %w{deploy@example.com}



# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
# These variables are then only loaded and set in this stage.
# For available Capistrano configuration variables see the documentation page.
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.



# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult the Net::SSH documentation.
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
#
# Global options
# --------------
set :ssh_options, {
    keys: %w(/home/deploy/.ssh/id_rsa),
#    forward_agent: false,
#    auth_methods: %w(password)
}
#
# The server-based syntax can be used to override options:
# ------------------------------------
# server "example.com",
#   user: "user_name",
#   roles: %w{web app},
#   ssh_options: {
#     user: "user_name", # overrides user setting above
#     keys: %w(/home/user_name/.ssh/id_rsa),
#     forward_agent: false,
#     auth_methods: %w(publickey password)
#     # password: "please use keys"
#   }
我添加了像/config/secrets.yml等文件


我可能没有使用好的练习来使用Capistrano。。。为什么我不能这样做?

您需要根据文档将此添加到您的CAP文件中

install_plugin Capistrano::Puma::Daemon#如果您使用Puma daemonized(Puma 5+中不支持)

干杯

bundle exec cap--任务--跟踪
有效

cap puma:make_dirs                  # Create Directories for Puma Pids and Socket
cap puma:nginx_config               # Setup nginx configuration
cap puma:phased-restart             # phased-restart puma
cap puma:restart                    # restart puma
cap puma:start                      # Start puma
cap puma:status                     # status puma
cap puma:stop                       # stop puma
cap puma:workers:count              # Add a worker
cap puma:workers:less               # Worker--
cap puma:workers:more               # Worker++
但是
cap部署
失败

➜ cap coffee deploy:check --trace
** Invoke coffee (first_time)
** Execute coffee
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
Don't know how to build task 'start' (See the list of available tasks with `cap --tasks`)
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task_manager.rb:59:in `[]'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:405:in `[]'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/dsl/task_enhancements.rb:7:in `before'
config/deploy.rb:207:in `block in <top (required)>'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task_manager.rb:232:in `in_namespace'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/dsl_definition.rb:141:in `namespace'
config/deploy.rb:199:in `<top (required)>'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/setup.rb:27:in `load'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/setup.rb:27:in `block (3 levels) in <top (required)>'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/configuration/variables.rb:32:in `untrusted!'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/2.7.0/delegate.rb:83:in `method_missing'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/setup.rb:26:in `block (2 levels) in <top (required)>'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `block in execute'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `each'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in `execute'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `synchronize'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in `invoke_with_call_chain'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:188:in `invoke'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:160:in `invoke_task'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `each'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:in `block in top_level'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:125:in `run_with_threads'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:110:in `top_level'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:83:in `block in run'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:80:in `run'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/application.rb:14:in `run'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/bin/cap:3:in `<top (required)>'
/Users/ram/.rbenv/versions/2.7.1/bin/cap:23:in `load'
/Users/ram/.rbenv/versions/2.7.1/bin/cap:23:in `<main>'
Tasks: TOP => coffee
➜ cap:检查--跟踪
**调用咖啡(第一次)
**执行咖啡
**调用加载:默认值(第一次)
**执行加载:默认值
帽子流产了!
不知道如何构建任务“开始”(请参阅带有“cap--tasks”的可用任务列表)
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task_manager.rb:59:in`[]'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:405:in`[]'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/dsl/task_enhancements.rb:7:in'before'
config/deploy.rb:207:in'block in'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task_manager.rb:232:in'in_namespace'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/dsl_definition.rb:141:在“名称空间”中
config/deploy.rb:199:in`'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/setup.rb:27:在“加载”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/setup.rb:27:in“block(3层)in”
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/configuration/variables.rb:32:in'untrusted!'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/2.7.0/delegate.rb:83:in'method_missing'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/setup.rb:26:in“block(2层)in”
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:在“执行中的块”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in'each'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:281:in'execute'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:219:in`block in invoke_with_call_chain'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:在“同步”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:199:in'invoke_with_call_chain'
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/task.rb:188:in“invoke”
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:160:在“调用任务”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:在“顶层的块(2层)”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:在'each'中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:116:在“顶层块”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:125:在“使用线程运行”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:110:“顶级”
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:83:在“运行中的块”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:186:在“标准异常处理”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/rake-13.0.3/lib/rake/application.rb:80:在“运行”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/lib/capistrano/application.rb:14:在“运行”中
/Users/ram/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/capistrano-3.14.1/bin/cap:3:in`'
/Users/ram/.rbenv/versions/2.7.1/bin/cap:23:在“加载”中
/Users/ram/.rbenv/versions/2.7.1/bin/cap:23:in`'
任务:TOP=>咖啡
修复:将
bundle exec
添加到
cap deploy
命令


改变了什么?:我使用了
oh my zsh
bundler
插件,该插件在我的shell中自动加载
bundle exec
,但最近我删除了它以加速终端启动

这主要是由于ruby、rails和ubuntu更新版本的问题。我也有同样的问题

在Capfile中,在最后一行之前添加了这一行,这解决了我的问题(仅当您的puma版本<5时)

参考以下教程。对某人会有帮助的。因为我花了很多时间来解决这个问题。
bundle exec cap--tasks--trace有效吗?
bundle exec
帮我解决了这个问题。你解决了吗?我刚刚将Rails应用程序升级到6.1,现在有了完全相同的问题。抱歉,我已尝试删除rbenv以安装rvm,现在我有其他问题。。。我回到五年前部署并发布的第一个项目,但是没有