在 cloud66 部署到 digitalocean 期间,尝试使用部署挂钩授予 /public/uploads 权限,以使carrierwave文件上传工作。我收到以下错误:
Error during deployment: Error during after_rails hook: Execution of sudo
/tmp/open_folder_permissions.sh returned a non-zero exit code. Output was:
/tmp/open_folder_permissions.sh:5: syntax error, unexpected tGVAR, expecting keyword_do or
'{' or '(' sudo chmod 0775 -R $RAILS_STACK_PATH/public/uploads ^
open_folder_permissions.sh
#! /usr/bin/env ruby
#load environment variables
source /var/.cloud66_env
#assign desired permissions
sudo chmod 0775 -R $RAILS_STACK_PATH/public/uploads
deploy_hooks.yml
production:
after_rails:
- source: /.cloud66/files/open_folder_permissions.sh
destination: /tmp/open_folder_permissions.sh
target: rails
execute: true
run_on: all_servers
apply_during: all
sudo: true
什么可能导致错误?