cap aborted! SSHKit::Runner::ExecuteError: Exception while executing on host

后端 未结 5 1662
名媛妹妹
名媛妹妹 2021-01-04 09:02

I\'m trying to deploy code with Capistrano 3 to Ubuntu server from GIT repository, but I\'m getting this error.

=====================================================

相关标签:
5条回答
  • 2021-01-04 09:21

    Capistrano wasn't able to create the folder on ec2. Once I created the folder it worked like a charm.

    So if you also have similar issues try creating the folder on ec2 and then execute the cap production deploy.

    0 讨论(0)
  • 2021-01-04 09:27

    So what are the permissions for /var/www/my_app in your remote machine ? Make sure they are owned by the same user that you specified in this config option:

    set :user, "mydeployuser"
    

    If not I believe Capistrano defaults to the user you are using to run the 'cap' command on the client machine. Make sure that it has permissions to modify/create /var/www/my_app

    Since you have:

    set :use_sudo, true
    

    it's possible that sudo may not be setup as passwordless sudo like suggested in the Cap 3 docs

    0 讨论(0)
  • 2021-01-04 09:35

    If all above solutions did not work for you, try this. It work for me. Cheer.

    ssh-add ~/.ssh/your_private_id_rsa
    and run
    eval `ssh-agent`
    

    Ref: http://mjacobus.github.io/2015/08/20/solving-weird-capistrano-problems-with-ssh-authentication.html

    0 讨论(0)
  • 2021-01-04 09:36

    Just write the command in console:

     ssh-add
    

    If that don't work, write below command in console:

     ssh-add ~/.ssh/id_rsa
    

    and then re-run the command (i.e. cap production deploy), It will work for sure.

    0 讨论(0)
  • 2021-01-04 09:36

    I had the same problem. Turns out I forgot to add my Gitlab instance SSH key (the 'runner') to my server's ~/.ssh/authorized_keys file.

    0 讨论(0)
提交回复
热议问题