0
votes

Trying to deploy a rails app using Capistrano, but authentication fails. The output while executing Capistrano, shows the correct IP for the server([email protected]), but the logfile shows ([email protected]), my previous IP. I have ssh keys set on github, both for the server and the local development machine.

Capistrano log

    DEBUG [deb63a13] Command: ( export GIT_ASKPASS="/bin/echo" GIT_SSH="/tmp/git-ssh-geofly-production-david.sh" ; /usr/bin/env git ls-remote https://github.com/uberdave/geofly.me.git HEAD )
 DEBUG [deb63a13]   remote: Invalid username or password.
 DEBUG [deb63a13]   f
 DEBUG [deb63a13]   atal: 
 DEBUG [deb63a13]   A
 DEBUG [deb63a13]   uthentication failed for '
 DEBUG [deb63a13]   h
 DEBUG [deb63a13]   ttps://github.com/uberdave/geofly.me.git/

Capfile

set :rvm_type, :user
set :rvm_ruby_version, '2.5.0'

# Load DSL and set up stages
require "capistrano/setup"
# Include default deployment tasks
require "capistrano/deploy"
require  'capistrano/bundler'
require 'capistrano/rails'

require 'capistrano/rvm'
require 'capistrano/passenger'


# Load the SCM plugin appropriate to your project:
#
# require "capistrano/scm/hg"
# install_plugin Capistrano::SCM::Hg
# or
# require "capistrano/scm/svn"
# install_plugin Capistrano::SCM::Svn
# or
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

deploy.rb

 # config valid for current version and patch releases of Capistrano

lock "~> 3.10.1"



 set :passenger_restart_with_touch, false

set :application, "geofly"

set :repo_url, "[email protected]:uberdave/geofly.git"

#"ssh://github.com:uberdave/geofly.me.git"

#https://github.com/uberdave/geofly.me.git



set :deploy_to, '/home/deploy/geofly'



append :linked_files, "config/database.yml", "config/secrets.yml"

append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "vendor/bundle", "public/system", "public/uploads"

production.rb

server '46.101.45.52', user: 'deploy', roles: %w{app db web}
1
Probably its log from earlier when your server ip was set to that...does the server's ssh key have access to github ...? - iamcaleberic
yes, git clone works so I am assuming the key has access. running cap production deploy today, results in: Gem::LoadError: can't activate mysql2 (~> 0.3.10), already activated mysql2-0.4.10. Make sure all dependencies are added to Gemfile. I did install the mysql adapter, and I tried adding gem 'mysql2' , '0.3.10' to gemfile, but it would not install. - uberdave
sudo apt-get install libmysqlclient-dev make sure yo have the mysql development libraries installed - iamcaleberic
you need to run bundle update mysql2 to update the gem since you updated the version. - iamcaleberic
yes, I have the libraries installed and I ran bundle update mysql2, but that failed - uberdave

1 Answers

0
votes

Capistrano was deploying the app,but the app was failing server side.