質問

I wrote this task to install git-core on Ubuntu. I am getting some weird errors, although it seems like the install finishing properly. Any idea why?

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

Here's the output with all the warnings. This doesn't happen with 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).
役に立ちましたか?

解決

In this case, it's not really an error, and will have no impact on the installation of your packages

apt-get complains because it is not working inside a regular Unix terminal. However, you can try to fix these warning by adding this directive in your Capistrano deploy file:

set :pty, true
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top