Ошибка синтаксиса звездочек при развертывании Capistrano - PullRequest
0 голосов
/ 07 декабря 2018

Я использую Rails 5.2.2 и ruby ​​2.3.1p112.Я развертываю свое приложение rails на сервер, используя capistrano.У меня есть эти драгоценные камни.

gem "capistrano", "~> 3.10", require: false
gem "capistrano-rails", "~> 1.4", require: false
gem 'capistrano-rvm'
gem 'capistrano3-puma', github: "seuros/capistrano-puma"
gem 'capistrano-bundler', require: false

Во время развертывания, когда Capistrano выполняет:

deploy:assets:backup_manifest

Я получаю следующую ошибку:

Capistrano Log:
02:04 deploy:assets:backup_manifest
      01 mkdir -p /home/developer/clapp/releases/20181207075748/assets_manifest_backup
      01 /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
    ✔ 01 developer@142.93.105.197 1.537s
      02 cp /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory  /home/developer/clapp/releases/20181207075748…
      02 /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
      02 bash: -c: line 0: syntax error near unexpected token `('
      02 bash: -c: line 0: `cd /home/developer/clapp/releases/20181207075748 && /usr/bin/env cp /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change loca…
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as developer@142.93.105.197: cp exit status: 1
cp stdout: /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `cd /home/developer/clapp/releases/20181207075748 && /usr/bin/env cp /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory  /home/developer/clapp/releases/20181207075748/public/assets/.sprockets-manifest-4b7cb236de58906a848ecfd6888fa29f.json /home/developer/clapp/releases/20181207075748/assets_manifest_backup'
cp stderr: Nothing written

Caused by:
SSHKit::Command::Failed: cp exit status: 1
cp stdout: /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `cd /home/developer/clapp/releases/20181207075748 && /usr/bin/env cp /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory  /home/developer/clapp/releases/20181207075748/public/assets/.sprockets-manifest-4b7cb236de58906a848ecfd6888fa29f.json /home/developer/clapp/releases/20181207075748/assets_manifest_backup'
cp stderr: Nothing written

Tasks: TOP => deploy:assets:backup_manifest
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as developer@142.93.105.197: cp exit status: 1
cp stdout: /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `cd /home/developer/clapp/releases/20181207075748 && /usr/bin/env cp /etc/profile.d/lang.sh: line 19: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory  /home/developer/clapp/releases/20181207075748/public/assets/.sprockets-manifest-4b7cb236de58906a848ecfd6888fa29f.json /home/developer/clapp/releases/20181207075748/assets_manifest_backup'
cp stderr: Nothing written


** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:

Может кто-нибудь предложить какие измененияМне нужно сделать для успешного развертывания?

ОБНОВЛЕНИЕ:

deploy.rb

lock "~> 3.11.0"

set :application, "myapp"
set :repo_url, "git@bitbucket.org:selise07/myapp.git"
set :branch, 'feature/push'
set :deploy_to, '/home/developer/myapp'
set :pty, true
set :default_shell, '/bin/bash -l'
set :linked_files, %w[config/secrets.yml config/database.yml .env]

set :linked_dirs, %w[bin log tmp/pids tmp/cache tmp/sockets vendor/bundle 
public/default public/files]
set :keep_releases, 5

set :rvm_type, :user                     # Defaults to: :auto
set :rvm_ruby_version, 'ruby-2.3.1'      # Defaults to: 'default'
append :rbenv_map_bins, 'puma', 'pumactl'

set :puma_rackup, -> { File.join(current_path, 'config.ru') }
set :puma_state, "#{shared_path}/tmp/pids/puma.state"
set :puma_pid, "#{shared_path}/tmp/pids/puma.pid"
set :puma_bind, "unix://#{shared_path}/tmp/sockets/puma.sock"    #accept array 
for multi-bind
set :puma_conf, "#{shared_path}/puma.rb"
set :puma_access_log, "#{shared_path}/log/puma_error.log"
set :puma_error_log, "#{shared_path}/log/puma_access.log"
set :puma_role, :app
set :puma_env, fetch(:rack_env, fetch(:rails_env, 'production'))
set :puma_threads, [0, 8]
set :puma_workers, 0
set :puma_worker_timeout, nil
set :puma_init_active_record, true
set :puma_preload_app, false

namespace :deploy do

  after :restart, :clear_cache do
    on roles(:web), in: :groups, limit: 3, wait: 10 do
      # Here we can do anything such as:
      # within release_path do
      #   execute :rake, 'cache:clear'
      # end
    end
  end
end
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...