2017-03-28 7 views
0

Ich habe erfolgreich mit Capistrano für mehrere Monate bereitgestellt. Nach einigen Updates funktioniert es nicht mehr.Rails 5.0.2, Capistrano gestoppt Bereitstellung

Kürzlich haben wir Spina CMS hinzugefügt, aber haben bereits eine Version, die live ist, bereitgestellt. Wir haben eine Capistrano-Sperre eine Weile entfernt.

Wenn ich laufen:

cap production deploy 
(Backtrace restricted to imported tasks) 
cap aborted! 
Don't know how to build task 'start' (see --tasks) 

Tasks: TOP => production 
(See full trace by running task with --trace) 

ich dann lief:

Daves-MBP-2:enduur dave$ cap production deploy --trace 
** Invoke production (first_time) 
** Execute production 
** Invoke load:defaults (first_time) 
** Execute load:defaults 
cap aborted! 
Don't know how to build task 'start' (see --tasks) 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task_manager.rb:58:in `[]' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:361:in `[]' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/lib/capistrano/dsl/task_enhancements.rb:7:in `before' 
config/deploy.rb:48:in `block in <top (required)>' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task_manager.rb:205:in `in_namespace' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/dsl_definition.rb:140:in `namespace' 
config/deploy.rb:39:in `<top (required)>' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/lib/capistrano/setup.rb:27:in `load' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/lib/capistrano/setup.rb:27:in `block (3 levels) in <top (required)>' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/lib/capistrano/configuration/variables.rb:32:in `untrusted!' 
/usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/delegate.rb:83:in `method_missing' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/lib/capistrano/setup.rb:26:in `block (2 levels) in <top (required)>' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:250:in `each' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain' 
/usr/local/rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:108:in `each' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling' 
/usr/local/rvm/gems/ruby-2.3.1/gems/rake-12.0.0/lib/rake/application.rb:77:in `run' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/lib/capistrano/application.rb:14:in `run' 
/usr/local/rvm/gems/ruby-2.3.1/gems/capistrano-3.8.0/bin/cap:3:in `<top (required)>' 
/usr/local/rvm/gems/ruby-2.3.1/bin/cap:23:in `load' 
/usr/local/rvm/gems/ruby-2.3.1/bin/cap:23:in `<main>' 
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval' 
/usr/local/rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>' 
Tasks: TOP => production 

Mein Gemfile

source 'https://rubygems.org' 



gem 'rails', '~> 5.0.2' 

gem 'sqlite3' 

group :development do 
    gem 'capistrano',   require: false 
    gem 'capistrano-rvm',  require: false 
    gem 'capistrano-rails', require: false 
    gem 'capistrano-bundler', require: false 
    gem 'capistrano3-puma', require: false 
end 
gem 'puma', '~> 3.0' 

gem 'sass-rails', '~> 5.0' 

gem 'uglifier', '>= 1.3.0' 

gem 'coffee-rails', '~> 4.2' 


gem "font-awesome-rails" 

gem 'mail_form' 

# Use jquery as the JavaScript library 
gem 'jquery-rails' 
gem 'turbolinks', '~> 5' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.5' 
# Use Redis adapter to run Action Cable in production 
# gem 'redis', '~> 3.0' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Capistrano for deployment 
# gem 'capistrano-rails', group: :development 

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

group :development do 
    # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 
    gem 'web-console' 
    gem 'listen', '~> 3.0.5' 
    # 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 

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 
gem 'globalize', git: 'https://github.com/globalize/globalize' 
gem 'spina', git: 'https://github.com/denkGroot/Spina' 
gem 'spina-articles', git: 'https://github.com/kinnrot/spina-articles.git' 
gem 'will_paginate', '~> 3.1.0' 
gem 'fog' 
gem 'pg' 
gem "wysiwyg-rails" 

es das Problem scheint die Puma Aufgabe innerhalb der Deploy-Datei.

Hier ist meine capfile:

# Load DSL and set up stages 
require "capistrano/setup" 
require "capistrano/deploy" 
require 'capistrano/rails' 
require 'capistrano/bundler' 
require 'capistrano/rvm' 
require 'capistrano/puma' 

# 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' 

# Load custom tasks from `lib/capistrano/tasks` if you have any defined 
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r } 

Hier meine Deploy-Datei ist:

# config valid only for current version of Capistrano 

server 'IP', port: 22, roles: [:web, :app, :db], primary: true 


set :application, 'APP' 
set :repo_url, 'URL' 
set :user,   'XX' 
set :puma_threads, [4, 16] 
set :puma_workers, 0 

# Don't change these unless you know what you're doing 
set :pty,    true 
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 :puma_preload_app, true 
set :puma_worker_timeout, nil 
set :puma_init_active_record, true # Change to false when not using ActiveRecord 

## Defaults: 
# set :scm,   :git 
# set :branch,  :master 
# set :format,  :pretty 
# set :log_level,  :debug 
# set :keep_releases, 5 

## Linked Files & Directories (Default None): 
# set :linked_files, %w{config/database.yml} 
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} 

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 

Antwort

0

Cant dies für die Antwort so Entschuldigungen als Kommentar hinzufügen, die keine Antwort ist. Ich habe heute eine App auf 5.0.2 hochgestuft und erfolgreich implementiert, wobei ich andere Fragen zum Fehler "Ich weiß nicht, wie ich gebaut werde" anschaue. Sie scheint auf die "require" -Zeilen in der Capfile zu zeigen. Ich würde vorschlagen, dass Sie sich das & ansehen, stellen Sie sicher, dass alles in Ordnung ist.

Verwandte Themen