我在将基本的 Rails 应用程序(在本地机器上工作,在 heroku 上工作)部署到分布式架构(一个机器上的 Web 服务器,另一个机器上的数据库服务器)时遇到问题。
这是我的问题。Capistrano 似乎无法更新我的数据库服务器上的缓存副本。
2013-05-12 11:32:57 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:morgs32/treebook.git master"
command finished in 1658ms
* executing multiple commands in parallel
-> "else" :: "if [ -d /home/morgan/apps/treebook/shared/cached-copy ]; then cd /home/morgan/apps/treebook/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 73b5a632d417b3a6863d542b174b30077265bc7c && git clean -q -d -x -f; else git clone -q -b master git@github.com:morgs32/treebook.git /home/morgan/apps/treebook/shared/cached-copy && cd /home/morgan/apps/treebook/shared/cached-copy && git checkout -q -b deploy 73b5a632d417b3a6863d542b174b30077265bc7c; fi"
-> "else" :: "if [ -d /home/morgan/apps/treebook/shared/cached-copy ]; then cd /home/morgan/apps/treebook/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 73b5a632d417b3a6863d542b174b30077265bc7c && git clean -q -d -x -f; else git clone -q -b master git@github.com:morgs32/treebook.git /home/morgan/apps/treebook/shared/cached-copy && cd /home/morgan/apps/treebook/shared/cached-copy && git checkout -q -b deploy 73b5a632d417b3a6863d542b174b30077265bc7c; fi"
servers: ["*app server ip*", "*database ip*"]
[*app server ip*] executing command
[*database ip*] executing command
** [*database ip* :: out] sh: 1: git: not found
command finished in 3072ms
*** [deploy:update_code] rolling back
* executing multiple commands in parallel
-> "else" :: "rm -rf /home/morgan/apps/treebook/releases/20130512183302; true"
-> "else" :: "rm -rf /home/morgan/apps/treebook/releases/20130512183302; true"
servers: ["*app server ip*", "*database ip*"]
[*app server ip*] executing command
[*database ip*] executing command
command finished in 201ms
failed: "sh -c 'if [ -d /home/morgan/apps/treebook/shared/cached-copy ]; then cd /home/morgan/apps/treebook/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 73b5a632d417b3a6863d542b174b30077265bc7c && git clean -q -d -x -f; else git clone -q -b master git@github.com:morgs32/treebook.git /home/morgan/apps/treebook/shared/cached-copy && cd /home/morgan/apps/treebook/shared/cached-copy && git checkout -q -b deploy 73b5a632d417b3a6863d542b174b30077265bc7c; fi'" on *database ip*
当然,无论您在哪里看到应用服务器 ip或数据库 ip ,我都有这些服务器的实际 ip。有任何想法吗?