Kapistrano "No tty present and no missed programs indicated"

I run cap production deploy and I keep getting the following sudo: no tty present and no askpass program specified error sudo: no tty present and no askpass program specified after /usr/bin/env sudo mkdir -pv /home/[user]/apps/[app name] as [ user@myIP ]

I am not sure how to fix this.

Capfile:

 require 'capistrano/setup' require 'capistrano/deploy' require 'capistrano/rvm' require 'capistrano/bundler' require 'capistrano/rails/migrations' require 'capistrano/passenger' require 'capistrano/safe_deploy_to' Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } 

any ideas?

+5
source share
1 answer

One solution would be to allow the sudo command on your server without entering a password , but this could be a security risk.

Alternatively, you can fix the Capistrano configuration because something is most likely incorrect. This would help if you showed us the contents of your deploy.rb file, but first of all I had to make sure that your default_run_options[:pty] set to true in deploy.rb . Or add a line if you are missing.

Capistrano 2

 default_run_options[:pty] = true 

Capistrano 3

 set :pty, true 
+12
source

All Articles