Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

capistrano errors

After executing

cap deploy:setup

I get this error

failed: "sh -c 'sudo -p '\\''sudo password: '\\'' mkdir -p /u/apps/blog /u/apps/blog/releases /u/apps/blog/shared /u/apps/blog/shared/system /u/apps/blog/shared/log /u/apps/blog/shared/pids'" on foobar.com

Here is the content of my deploy.rb

require 'capistrano'


    # Account Settings
    set :user, "user"
    set :password, "pass"
    set :domain, "foobar.com"
    set :mount_path, "/"
    set :application, "blog"

    set :repository, "/Users/me/Desktop/project"
    set :local_repository, "/Users/me/Desktop/project"
    set :scm, :git
    set :deploy_via, :copy

    role :app, 'foobar.com'
role :web, 'foobar.com'

What could be the problem ?

//EDIT

*** [err :: foobar.com] stdin: is not a tty
*** [err :: foobar.com] sudo:
*** [err :: foobar.com] can't mkdir /var/db/sudo: No such file or directory
*** [err :: foobar.com] sudo:
*** [err :: foobar.com] no tty present and no askpass program specified
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' mkdir -p /u/apps/blog /u/apps/blog/releases /u/apps/blog/shared /u/apps/blog/shared/system /u/apps/blog/shared/log /u/apps/blog/shared/pids'" on foobar.com
like image 454
mojodro Avatar asked Nov 28 '22 02:11

mojodro


2 Answers

Add this line to your deploy.rb (for example after set :application, "blog")

default_run_options[:pty] = true

And now run:

cap -v deploy:setup

If you don't have sudo privileges add this line to deploy.rb:

set :use_sudo, false

You must have permissions to create /u/apps/blog directory or change deploy folder with:

set :deploy_to, "/home/user_name/apps/blog"
like image 120
rogal111 Avatar answered Dec 05 '22 13:12

rogal111


# Default value for :pty is false
set :pty, true
like image 40
gavit Avatar answered Dec 05 '22 14:12

gavit