使用Capistrano 3安装git-core

时间:2014-01-21 17:24:01

标签: ubuntu capistrano capistrano3

我写了这个任务,在Ubuntu上安装git-core。我得到一些奇怪的错误,虽然看起来安装正常完成。知道为什么吗?

namespace :git do
  desc "Install git-core library"
  task :install do
    on roles(:app) do |h|
      execute "apt-get -y update"
      execute "apt-get -y install git-core"
      execute "apt-get -y update"
    end
  end
end

这是带有所有警告的输出。 capistrano-2不会发生这种情况。

DEBUG [a396ccf2] Command: apt-get -y install git-core
DEBUG [a396ccf2]    Reading package lists...
DEBUG [a396ccf2]    
DEBUG [a396ccf2]    Building dependency tree...
DEBUG [a396ccf2]    
DEBUG [a396ccf2]    Reading state information...
DEBUG [a396ccf2]    
DEBUG [a396ccf2]    The following extra packages will be installed:
DEBUG [a396ccf2]      git git-man liberror-perl
DEBUG [a396ccf2]    Suggested packages:
DEBUG [a396ccf2]      git-daemon-run git-daemon-sysvinit git-doc git-el git-email git-gui gitk
DEBUG [a396ccf2]      gitweb git-arch git-bzr git-cvs git-svn
DEBUG [a396ccf2]    The following NEW packages will be installed:
DEBUG [a396ccf2]      git git-core git-man liberror-perl
DEBUG [a396ccf2]    0 upgraded, 4 newly installed, 0 to remove and 55 not upgraded.
DEBUG [a396ccf2]    Need to get 8,730 kB of archives.
DEBUG [a396ccf2]    After this operation, 19.8 MB of additional disk space will be used.
DEBUG [a396ccf2]    Get:1 http://us.archive.ubuntu.com/ubuntu/ saucy/main liberror-perl all 0.17-1 [23.8 kB]
DEBUG [a396ccf2]    Get:2 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-man all 1:1.8.3.2-1 [670 kB]
DEBUG [a396ccf2]    Get:3 http://us.archive.ubuntu.com/ubuntu/ saucy/main git amd64 1:1.8.3.2-1 [8,035 kB]
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    debconf: unable to initialize frontend: Dialog
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    debconf: (TERM is not set, so the dialog frontend is not usable.)
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    debconf: falling back to frontend: Readline
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    debconf: unable to initialize frontend: Readline
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    debconf: (This frontend requires a controlling tty.)
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    debconf: falling back to frontend: Teletype
DEBUG [a396ccf2]    Get:4 http://us.archive.ubuntu.com/ubuntu/ saucy/main git-core all 1:1.8.3.2-1 [1,386 B]
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Fetched 8,730 kB in 1s (7,663 kB/s)
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Selecting previously unselected package liberror-perl.
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    (Reading database ... 
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    56184 files and directories currently installed.)
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Unpacking liberror-perl (from .../liberror-perl_0.17-1_all.deb) ...
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Selecting previously unselected package git-man.
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Unpacking git-man (from .../git-man_1%3a1.8.3.2-1_all.deb) ...
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Selecting previously unselected package git.
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Unpacking git (from .../git_1%3a1.8.3.2-1_amd64.deb) ...
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Selecting previously unselected package git-core.
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Unpacking git-core (from .../git-core_1%3a1.8.3.2-1_all.deb) ...
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    dpkg-preconfigure: unable to re-open stdin: 
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    debconf: unable to initialize frontend: Dialog
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    debconf: (TERM is not set, so the dialog frontend is not usable.)
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    debconf: falling back to frontend: Readline
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    debconf: unable to initialize frontend: Readline
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    debconf: (This frontend requires a controlling tty.)
DEBUG [a396ccf2]    Processing triggers for man-db ...
DEBUG [a396ccf2]    debconf: falling back to frontend: Teletype
DEBUG [a396ccf2]    Setting up liberror-perl (0.17-1) ...
DEBUG [a396ccf2]    debconf: falling back to frontend: Teletype
DEBUG [a396ccf2]    Setting up git-man (1:1.8.3.2-1) ...
DEBUG [a396ccf2]    debconf: falling back to frontend: Teletype
DEBUG [a396ccf2]    Setting up git (1:1.8.3.2-1) ...
DEBUG [a396ccf2]    debconf: falling back to frontend: Teletype
DEBUG [a396ccf2]    Setting up git-core (1:1.8.3.2-1) ...
DEBUG [a396ccf2]    debconf: falling back to frontend: Teletype
 INFO [a396ccf2] Finished in 9.076 seconds with exit status 0 (successful).

1 个答案:

答案 0 :(得分:2)

在这种情况下,这不是一个真正的错误,并且对包的安装没有影响

apt-get抱怨因为它不能在普通的Unix终端内工作。 但是,您可以尝试通过在Capistrano部署文件中添加此指令来修复这些警告:

set :pty, true