Capifony + Symfony2:使用cap deploy到我的服务器时出错

时间:2012-02-07 16:49:00

标签: symfony capifony

我想将我的Symfony2项目部署到我的服务器和capifony中,但我遇到了问题:

[server.com] executing command
*** [err :: server.com] find: /home/app/src/releases/20120207163503/web/css: No such file or directory
*** [err :: server.com] 
*** [err :: server.com] find: /home/app/src/releases/20120207163503/web/images: No such file or directory
*** [err :: server.com] find: /home/app/src/releases/20120207163503/web/js
*** [err :: server.com] : No such file or directory

脚本继续,但我有其他错误

* executing "cd /home/app/src/releases/20120207163503 && /usr/local/php5/bin/php bin/vendors install --reinstall"
servers: ["server.com"]
[server.com] executing command
 ** [out :: server.com] X-Powered-By: PHP/5.3.8-pl0-gentoo
 ** [out :: server.com] Content-type: text/html
 ** [out :: server.com] 
 ** [out :: server.com] <br />
 ** [out :: server.com] <b>Warning</b>:  Wrong parameter count for parse_ini_file() in <b>/home/app/src/releases/20120207163503/bin/vendors</b> on line <b>69</b><br />
  ** [out :: server.com] <br />
  ** [out :: server.com] <b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/app/src/releases/20120207163503/bin/vendors</b> on line <b>73</b><br />
 *** [err :: server.com] sh: ./vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php: No such file or directory
 *** [err :: server.com] sh: ./app/console: No such file or directory
 *** [err :: server.com] sh: ./app/console: No such file or directory
     command finished in 369ms

我已关注ServerGrove tutorial

这是我的deploy.rb文件

set :serverName,   "server.com" # The server's hostname
set :repository,   "file:///Applications/MAMP/htdocs/sf2"

set :domain,      "server.com"
set :deploy_to,   "/home/app/src" # Remote location where the project will be stored
ssh_options[:port] = "22"

set :scm,         :git
set :deploy_via,  :rsync_with_remote_cache
set :user,        "root"

# Roles
role :web,        domain
role :app,        domain
role :db,         domain, :primary => true

set  :keep_releases,  3 # The number of releases which will remain on the server
set  :use_sudo,       false

# Update vendors during the deploy
set :update_vendors, true

# Set some paths to be shared between versions
set :shared_files,    ["app/config/parameters.ini"]
set :shared_children, [app_path + "/logs", web_path + "/uploads", "vendor"]

编辑:我已将php版本更改为5.3.8并且完全相同的错误。

3 个答案:

答案 0 :(得分:0)

问题不是来自Capifony。看起来您只需要在deps文件的末尾添加一个新行。然后尝试再次部署。

希望有所帮助!

答案 1 :(得分:0)

在尝试将capifony(official documentation)发送到另一台服务器之前,请确保您的项目在本地计算机上运行(运行./bin/vendors install --reinstall)。

对我而言,您似乎使用了不匹配的依赖项版本。我会将这些文件(./bin/vendorsdepsdeps.lock)的内容与Symfony Standard distribution中打包的文件进行比较。

希望有所帮助:)

答案 2 :(得分:0)

我找到了问题。

这是因为git没有安装到服务器上供所有用户使用......