[root@vm02 ~]# which gem
/usr/local/bin/gem
[root@vm02 ~]#
[root@vm02 ~]# gem install capistrano
Fetching: highline-1.6.15.gem (100%)
Fetching: net-ssh-2.6.3.gem (100%)
Fetching: net-sftp-2.0.5.gem (100%)\]
Fetching: net-scp-1.0.4.gem (100%)
Fetching: net-ssh-gateway-1.1.0.gem (100%)
Fetching: capistrano-2.14.1.gem (100%)
Successfully installed highline-1.6.15
Successfully installed net-ssh-2.6.3
Successfully installed net-sftp-2.0.5
Successfully installed net-scp-1.0.4
Successfully installed net-ssh-gateway-1.1.0
Successfully installed capistrano-2.14.1
6 gems installed
Installing ri documentation for highline-1.6.15...
Installing ri documentation for net-ssh-2.6.3...
Installing ri documentation for net-sftp-2.0.5...
Installing ri documentation for net-scp-1.0.4...
Installing ri documentation for net-ssh-gateway-1.1.0...
Installing ri documentation for capistrano-2.14.1...
Installing RDoc documentation for highline-1.6.15...
Installing RDoc documentation for net-ssh-2.6.3...
Installing RDoc documentation for net-sftp-2.0.5...
Installing RDoc documentation for net-scp-1.0.4...
Installing RDoc documentation for net-ssh-gateway-1.1.0...
Installing RDoc documentation for capistrano-2.14.1...
[root@vm02 ~]
[root@vm02 ~]
*** LOCAL GEMS ***
capistrano (2.14.1)
daemon_controller (1.1.0)
fastthread (1.0.7)
highline (1.6.15)
i18n (0.4.2)
json (1.7.6)
mysql (2.9.0)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.3)
net-ssh-gateway (1.1.0)
passenger (3.0.18)
rack (1.1.2)
rake (0.9.2)
rdoc (3.12)
rmagick (2.13.1)
rubygems-update (1.6.2)
rubytree (0.8.3)
structured_warnings (0.1.3)
[root@vm02 ~]
[root@vm02 ~]
[add] making directory './config'
[add] writing './config/deploy.rb'
[add] writing './Capfile'
[done] capified!
[root@vm02 ~]
・
・
drwxr-xr-x 2 root root 4096 1月 14 06:29 2013 config
-rw-r--r-- 1 root root 172 1月 14 06:29 2013 Capfile
[root@vm02 ~]
role :server, 'localhost', 'localhost'
set :user, 'hoge'
set :password, 'hogehoge'
desc "reporting disk usage with 'df -h'"
task :check_disk, :roles => :server do
run 'df -h'
end
[root@vm02 ~]
[root@vm02 ~]
[root@vm02 ~]
* 2013-01-15 08:26:41 executing `check_disk'
* executing "df -h"
servers: ["localhost"]
[localhost] executing command
** [out :: localhost] Filesystem Size Used Avail Use% マウント位置
** [out :: localhost] /dev/sda2 18G 3.3G 14G 20% /
** [out :: localhost] tmpfs 495M 276K 495M 1% /dev/shm
** [out :: localhost] /dev/sda1 291M 32M 244M 12% /boot
command finished in 787ms
[root@vm02 ~]#