這是我第一次嘗試設置capistrano來部署一個rails應用程序。我正在從本地機器部署到遠程服務器,該服務器在同一臺機器上具有repo,web,app和mysql服務器。我通過以下這一走:http://www.capify.org/index.php/From_The_Beginning未知用戶'cap'與capistrano
我得到命令
cap deploy:start
然後我得到這個錯誤:
*** [err :: example.com] sudo: unknown user: app
command finished
failed: "sh -c 'cd /var/www/example/current && sudo -p '\\''sudo password: '\\'' -u app nohup script/spin'" on example.com
我應該添加一個「應用程序」的用戶,或者是有一種方法可以改變命令的運行方式嗎?
這是我deploy.rb:
set :application, "example"
set :repository, "[email protected]:example.git"
set :user, "trobrock"
set :branch, 'master'
set :deploy_to, "/var/www/example"
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
role :web, "example.com" # Your HTTP server, Apache/etc
role :app, "example.com" # This may be the same as your `Web` server
role :db, "example.com", :primary => true # This is where Rails migrations will run
而且很明顯到處它說example.com是我的服務器的主機名和每一個它只是說,例如是應用程序的名稱。