Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 参数数目错误capistrano部署时出错_Ruby_Symfony_Capistrano - Fatal编程技术网

Ruby 参数数目错误capistrano部署时出错

Ruby 参数数目错误capistrano部署时出错,ruby,symfony,capistrano,Ruby,Symfony,Capistrano,deploy.rb # config valid only for current version of Capistrano lock "3.8.2" set :application, "wisdom" set :repo_url, "ssh://app@extreammmm.jp/home/app/myGit/wisdom.git" set :branch, 'master' set :deploy_to, "/var/www/html/wisdom" set :linked_fil

deploy.rb

# config valid only for current version of Capistrano
lock "3.8.2"

set :application, "wisdom"
set :repo_url, "ssh://app@extreammmm.jp/home/app/myGit/wisdom.git"

set :branch, 'master'
set :deploy_to, "/var/www/html/wisdom"

set :linked_files, %w{app/config/parameters.yml}
set :linked_dirs, %w{app/logs app/spool app/cache vendor web/vendor node_modules web/assets}
#somehow app/cache doesn't work...


set :format, :pretty
set :log_level, :debug
set :keep_releases, 3

after 'deploy:update_code' do
  capifony_pretty_print "--> Ensuring cache directory permissions"
  run "setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX #{latest_release}/#{cache_path}"
  run "setfacl -dR -m u:www-data:rwX -m u:`whoami`:rwX #{latest_release}/#{cache_path}"
  capifony_puts_ok
end

after 'deploy:starting', 'composer:install_executable'
#after 'deploy:updated', 'npm:install'   # remove it if you don't use npm
#after 'deploy:updated', 'bower:install' # remove it if you don't use bower
after 'deploy:updated', 'symfony:assets:install'
after 'deploy:updated', 'symfony:assetic:dump'
部署后,我想更改
app/cache
777的权限

起初,我把
app/cache
放在
linked\u dirs
中,但不知何故它不起作用

因此,现在我试图通过acl更改权限,并将此
deploy.rb

但是,此代码显示错误

ArgumentError:参数数目错误(给定1,预期2+)

我猜这个错误与'deploy:update_code'do之后的
有关,尽管我不确定如何修复它

请有人帮我吗

cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
ArgumentError: wrong number of arguments (given 1, expected 2+)
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/lib/capistrano/dsl/task_enhancements.rb:10:in `after'
config/deploy.rb:19:in `<top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/lib/capistrano/setup.rb:27:in `load'
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/lib/capistrano/setup.rb:27:in `block (3 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/lib/capistrano/configuration/variables.rb:32:in `untrusted!'
/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/delegate.rb:83:in `method_missing'
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/lib/capistrano/setup.rb:26:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `block in execute'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:250:in `execute'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:in `block in invoke_with_call_chain'
/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:in `invoke_with_call_chain'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in `invoke'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:in `invoke_task'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block (2 levels) in top_level'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `each'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in `block in top_level'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:in `run_with_threads'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in `top_level'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:80:in `block in run'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/lib/capistrano/application.rb:14:in `run'
/usr/local/lib/ruby/gems/2.4.0/gems/capistrano-3.8.2/bin/cap:3:in `<top (required)>'
/usr/local/bin/cap:22:in `load'
/usr/local/bin/cap:22:in `<main>'
Tasks: TOP => production

显示错误的完整堆栈跟踪。我添加了完整堆栈跟踪错误。是否存在
config/deploy.rb:28
line?我认为应该在“deploy:update\u code”之后
,:updated\u cache do。。结束
@kiddorails谢谢,它很有效,所以我更新了我的文章添加解决方案。显示错误的完整堆栈跟踪。我添加了完整堆栈跟踪错误。是否有
config/deploy.rb:28
行?我想应该是
在'deploy:update\u code',:updated\u cache do。。结束
@kiddorails谢谢,它很有效,所以我更新了我的文章添加解决方案。
after 'deploy:updated', :updated_cache do 
  on roles(:app) do
     execute :chmod, "-R 777 #{fetch(:deploy_to)}/current/#{fetch(:cache_path)}"
  end
end