나는 capistrano in ruby script 문서를 따라 갔다.capistrano 3 pury ruby error - '빌드'하는 방법을 모른다 : '
내 파일 :
$ ls
deploy.rb Gemfile Gemfile.lock
카피 스트라 노 버전 :
$ cat Gemfile | grep -i cap
gem "capistrano", "3.2.1"
루비 버전 :
$ bundle exec ruby --version
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux-gnu]
루비 스크립트 :
require "capistrano/all"
set :application, "my_app"
set :deploy_to, "/home/my_app"
set :tmp_dir, "/tmp"
set :keep_releases, 5
SSHKit::Backend::Netssh.configure { |ssh| ssh.ssh_options = { forward_agent: true, port: 22, user: "deploy_user", keys: "/ssh/key" } }
server "host.example.com", roles: [:myrole]
require "capistrano/setup"
require "capistrano/deploy"
cap_gem_dir = File.join Gem::Specification.find_by_name("capistrano").gem_dir, "lib", "capistrano", "tasks", "*.rake"
Dir.glob(cap_gem_dir).each { |r| import r }
Capistrano::Application.invoke("deploy")
실행 - Don't know how to build task ':check'
을 - ':check'
가 'deploy:check'
을 있어야 할 곳에 내가 확실하지 않지만
$ bundle exec ruby deploy.rb
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
/var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task_manager.rb:62:in `[]': Don't know how to build task ':check' (RuntimeError)
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:353:in `[]'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/dsl.rb:15:in `invoke'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/deploy.rake:36:in `block (2 levels) in <top (required)>'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
from /usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/dsl.rb:15:in `invoke'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/deploy.rake:4:in `block (2 levels) in <top (required)>'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
from /usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/dsl.rb:15:in `invoke'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/framework.rake:65:in `block (2 levels) in <top (required)>'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/framework.rake:64:in `each'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/framework.rake:64:in `block in <top (required)>'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
from /usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
from /var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
from /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/dsl.rb:15:in `invoke'
from deploy.rb:13:in `<main>'
, 네임 스페이스가없는 것으로 보인다.
갱신 :
이 scm
변수가 설정되어야 함을 보인다.
$ grep -nH scm /var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/deploy.rake
/var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/deploy.rake:9: invoke "#{scm}:create_release"
/var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/deploy.rake:36: invoke "#{scm}:check"
/var/lib/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/tasks/deploy.rake:205: invoke "#{scm}:set_current_revision"
set :scm, "deploy"
가 계속하자 추가,하지만 그것은 고정 할 수있는 방법을 당신이 나 오류 무엇인지 이해하는 데 도움이 바랍니다 수
/var/lib/gems/2.1.0/gems/rake-10.3.2/lib/rake/task_manager.rb:62:in `[]': Don't know how to build task 'deploy:create_release' (RuntimeError)
실패하고?
감사합니다.
답장을 보내 주셔서 감사합니다. 둘째로,'scm'을': git'으로 설정해도 문제가 해결되지 않으면 위의'grep' 업데이트를보십시오. 또한,'set : stage, : production '을 추가하는 것은'Capistrano :: Application.invoke ("production")'이 호출되지 않았기 때문에 아무런 효과가 없다. 하지만, 나는 그것을 설정, 그것은'scm으로 인해 실패합니다. 다른 아이디어? btw, 당신은 당신의 제안을 시험해 볼 수 있었고, 당신은 무엇이든 필요합니다. – MrRoth