質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

2270閲覧

capistrano3 でデプロイ時のSkipping task `puma:restart'.の解決方法がわからないので教えていただけないでしょうか?

koume

総合スコア458

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2019/03/18 10:17

Railsアプリケーションをcapistrano3でデプロイしたいのですが、
$ bundle exec cap production deploy --trace --dry-run を実行すると以下のような表示が出てきます。これってなんでしょうか?エラーなのでしょうか?

Skipping task `puma:restart'. Capistrano tasks may only be invoked once. Since task `puma:restart' was previously invoked, invoke("puma:restart") at /home/vagrant/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/capistrano3-puma-3.1.1/lib/capistrano/tasks/puma.rake:96 will be skipped. If you really meant to run this task again, use invoke!("puma:restart") THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF CAPISTRANO. Please join the conversation here if this affects you. https://github.com/capistrano/capistrano/issues/1686

pumaの再起動関連についてのメッセージのようですがサイトで調べてもわからないので
どなかご教示お願いします。関連すると思われるコードは以下になります。

Capfile # Load DSL and set up stages require "capistrano/setup" # Include default deployment tasks require "capistrano/deploy" # Load the SCM plugin appropriate to your project: # # require "capistrano/scm/hg" # install_plugin Capistrano::SCM::Hg # or require "capistrano/scm/git" install_plugin Capistrano::SCM::Git #require 'capistrano/git_copy' #install_plugin Capistrano::GitCopy::SCM # or require 'capistrano/rails' # Include tasks from other gems included in your Gemfile # # For documentation on these, see for example: # # https://github.com/capistrano/rvm # https://github.com/capistrano/rbenv # https://github.com/capistrano/chruby # https://github.com/capistrano/bundler # https://github.com/capistrano/rails # https://github.com/capistrano/passenger # require 'capistrano/rvm' require 'capistrano/rbenv' require 'capistrano/chruby' require 'capistrano/bundler' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' require 'capistrano/passenger' require 'capistrano/puma' #install_plugin Capistrano::Puma require 'sshkit/sudo' require 'whenever/capistrano' require "capistrano/maintenance" # Load custom tasks from `lib/capistrano/tasks` if you have any defined Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } install_plugin Capistrano::Puma
config/deploy.rb lock "~> 3.11.0" set :application, "chibi" set :repo_url, "git@example.com:me/my_repo.git" #set :branch, master set :conditionally_migrate, true set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" } set :scm, :git set :user, 'mikan' set :puma_threads, [4, 16] set :puma_workers, 0 set :pty, true set :use_sudo, false set :stage, :production set :deploy_via, :remote_cache set :deploy_to, "/var/www/html" set :puma_bind, "unix://#{shared_path}/tmp/sockets/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.access.log" set :puma_error_log, "#{release_path}/log/puma.error.log" set :puma_preload_app, true set :puma_worker_timeout, nil set :puma_init_active_record, true set :rbenv_type, :system set :rbenv_path, '/usr/local/rbenv' set :rbenv_ruby, '2.3.1-p112' set :chruby_ruby, 'ruby-2.3.1-p112' set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec" set :rbenv_map_bins, %w[rake gem bundle ruby rails] set :linked_dirs, fetch(:linked_dirs, []).push( 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/uploads' ) set :linked_files, fetch(:linked_files, []).push( 'config/database.yml', 'config/secrets.yml', '.env' ) set :whenever_identifier, -> { "#{fetch(:application)}_#{fetch(:stage)}" } set :passenger_rvm_ruby_version, '2.3.1-p112' set :passenger_environment_variables, { :path => '/path-to-passenger/bin:$PATH' } set :passenger_restart_command, "/path-to-passenger/bin/passenger-config restart-app #{deploy_to}" set :passenger_restart_with_touch, true 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` 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 Rake::Task["puma:restart"].reenable invoke 'puma:restart' end end desc "Resterts application." task :restart do on roles :all do execute :mkdir, "-p :#{shared_path}/tmp" execute :touch, "#{shared_path}/tmp/restart.txt" end end desc 'reload the database with seed data' task :seed do on roles(:db) do with rails_env: fetch(:rails_env) do within release_path do execute :bundle, :exec, :rake, 'db:seed' end end end end after :migrate, :seed before :starting, :check_revision after :finishing, :compile_assets after :finishing, :cleanup end require "capistrano/maintenance" set :maintenance_template_path, File.join(File.dirname(__FILE__), "..", "app", "views", "system", "maintenance.html.erb") $VERBOSE = nil namespace :db do desc "Dump the database and compress it." task :backup do on roles(:db) do #task :backup, :roles => :db, :only => { :primary => true } do backups_path = "#{shared_path}/db_backups" date = capture "cat #{current_path}/config/database.yml" config = YAML::load(data)[rails_env] abort unless config && config['adapter'] == 'mysql2' file_name = "#{config['database']}-#{release_name}.sql.gz" command = "/usr/bin/mysqldump --user=#{config['username']}" command += " --password" if config['password'] command += " --host=#{config['host']}" if config['host'] command += " --port=#{config['port']}" if config['port'] command += " #{config['database']}" command += " | gzip -c > #{backups_path}/#{file_name}" run "mkdir -p #{backups_path}" run command do |channel, _, output| if output =~ /^Enter password:/ channel.send_data "#{config['password']}n" end end end end end Rake::Task["deploy:new_release_path"].clear namespace :deploy do task :new_release_path do set_release_path(Time.now.strftime("%Y%m%d%H%M%S")) end end

宜しくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

質問内容を変更させていただきます。

投稿2019/03/20 07:19

koume

総合スコア458

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問