Я следил за руководством по развертыванию на aws ec2 https://www.sitepoint.com/deploy-your-rails-app-to-aws/.ошибка развертывания моего приложения rails с capisrano на aws
Я использую сервер ubuntu 16.
Все установлено отлично на сервере, но когда я запускаю cap production deploy --trace
, это результат.
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Execute rvm:hook
** Invoke rvm:check (first_time)
** Execute rvm:check
cap aborted!
Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:90:in `rescue in initialize'
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:57:in `initialize'
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `new'
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `start'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/connection_pool.rb:59:in `call'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/connection_pool.rb:59:in `with'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/netssh.rb:155:in `with_ssh'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/netssh.rb:108:in `execute_command'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `tap'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:60:in `capture'
/var/lib/gems/2.1.0/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `run'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Errno::ETIMEDOUT: Connection timed out - connect(2) for 172.31.11.127:22
/usr/lib/ruby/2.1.0/socket.rb:65:in `connect'
/usr/lib/ruby/2.1.0/socket.rb:65:in `connect_internal'
/usr/lib/ruby/2.1.0/socket.rb:140:in `connect'
/usr/lib/ruby/2.1.0/socket.rb:338:in `block in tcp'
/usr/lib/ruby/2.1.0/socket.rb:232:in `each'
/usr/lib/ruby/2.1.0/socket.rb:232:in `foreach'
/usr/lib/ruby/2.1.0/socket.rb:328:in `tcp'
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh/transport/session.rb:70:in `initialize'
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `new'
/var/lib/gems/2.1.0/gems/net-ssh-3.2.0/lib/net/ssh.rb:232:in `start'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/connection_pool.rb:59:in `call'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/connection_pool.rb:59:in `with'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/netssh.rb:155:in `with_ssh'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/netssh.rb:108:in `execute_command'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `tap'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:60:in `capture'
/var/lib/gems/2.1.0/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:9:in `block (3 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `run'
/var/lib/gems/2.1.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rvm:check
Моего Capistrano production.rb файл:
server '172.31.11.127', user: 'deploy', roles: %w{web app db}
Capistrano deploy.rb файл My:
set :branch, :master
set :deploy_to, '/home/deploy/rd'
set :pty, true
set :linked_files, %w{config/database.yml config/application.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads}
set :keep_releases, 5
set :rvm_type, :user
set :rvm_ruby_version, 'ruby 2.1.5'
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
попытаться проверить в командной строке ssh [email protected], а при добавлении открытого ключа в файле authorized_keys сервера необходимо перезапустить службу ssh. – Pratap
я перезапустил службу и все еще получаю сообщение об ошибке. Кто или что принадлежит ip 52.2.139.74? –
sry error для ip 52.2.139.74 – Pratap