@mirbook

Почему не работает деплой capistrano?

Ошибка: при cap production deploy:check

DEBUG [18b100c4] Running /usr/bin/env [ -d ~/.rvm ] as app@95.213.204.96
DEBUG [18b100c4] Command: [ -d ~/.rvm ]
cap aborted!
Net::SSH::AuthenticationFailed: Authentication failed for user app@95.213.204.96
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/net-ssh-2.9.2/lib/net/ssh.rb:224:in `start'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/connection_pool.rb:95:in `call'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/connection_pool.rb:95:in `create_new_entry'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/connection_pool.rb:38:in `checkout'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:134:in `with_ssh'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/netssh.rb:87:in `execute_command'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:121:in `block in create_command_and_execute'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:121:in `tap'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:121:in `create_command_and_execute'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:34:in `test'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/capistrano-rvm-0.1.2/lib/capistrano/tasks/rvm.rake:21:in `block (3 levels) in <top (required)>'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `instance_exec'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/backends/abstract.rb:15:in `run'
/home/frostball77/.rvm/gems/ruby-2.2.1/gems/sshkit-1.8.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => rvm:hook


# config valid only for Capistrano 3.1
lock '3.2.1'

set :application, 'Pso'

# Default branch is :master
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call

# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/home/app/pso'

# Default value for :scm is :git
set :scm, :git

# Default value for :format is :pretty
set :format, :pretty

# Default value for :log_level is :debug
set :log_level, :debug

# Default value for :pty is false
set :pty, true

# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}

# Default value for linked_dirs is []
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }

# Default value for keep_releases is 5
set :keep_releases, 5

# Thin application server
set :thin_config_path, -> { "#{current_path}/config/thin.yml" }

namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      # Your restart mechanism here, for example:
      # execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after 'deploy:publishing', 'thin:restart'

  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


production.rb
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary server in each group
# is considered to be the first unless any hosts have the primary
# property set.  Don't declare `role :all`, it's a meta role.

server '95.213.204.96',
  user: 'app',
  roles: %w{web app db},
  ssh_options: {
    auth_methods: %w(publickey)
  }


Gemfile
source "https://rubygems.org"

gem 'less-rails'
gem 'bliblob', git: 'git@gitlab.com:sqcat/bliblob.git', branch: 'edge'
gem 'galetahub-simple_captcha', require: 'simple_captcha'
gem 'ckeditor'

gem 'sass-rails'

gem 'tire'

group :development, :test do
  # Deploy project with capistrno
  gem 'capistrano-rails', '~> 1.1.1'
  gem 'capistrano-rvm'
  gem 'capistrano-thin'
  gem 'capistrano', '~> 3.2.0'
  gem 'net-ssh', '~> 2.9.0'

  # An IRB alternative and runtime developer console
  gem 'pry-rails'

  # Mutes assets pipeline log messages
  gem 'quiet_assets'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end
  • Вопрос задан
  • 327 просмотров
Решения вопроса 1
@mirbook Автор вопроса
Блин ответ нашел в одном из похожих вопросов:
копируешь ~/.ssh/id_rsa.pub у себя на локалке и отдаешь его в ~/.ssh/authorized_key о уже на своем vps
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы