0

我正在尝试部署一个新站点,但我不明白为什么会出现一些奇怪的错误。

我的第一个错误是:

Users/Epok/.rvm/gems/ruby-1.9.3-p448/gems/capifony-2.2.10/lib/capifony_symfony1.rb:40:in `read': No such file or directory - config/databases.yml (Errno::ENOENT)
from /Users/Epok/.rvm/gems/ruby-1.9.3-p448/gems/capifony-2.2.10/lib/capifony_symfony1.rb:40:in `guess_symfony_orm'
from /Users/Epok/.rvm/gems/ruby-1.9.3-p448/gems/capifony-2.2.10/lib/capifony_symfony1.rb:27:in `block in load'

我不明白为什么 capifony 向我询问 database.yml 这是 Symfony 1 的文件(我认为)

所以我输入:set:use_orm, false(正如 symfony1 项目的文档所说)它可以工作,但现在我有一个新错误:

  * executing "sh -c 'cd /usr/share/nginx/www/stackexchange/releases/20130820143357 && php ./symfony cache:clear'"
 servers: ["37.187.66.229"]
 [37.187.66.229] executing command
 ** [out :: 37.187.66.229] Could not open input file: ./symfony
     command finished in 255ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /usr/share/nginx/www/stackexchange/releases/20130820143357; true"
servers: ["37.187.66.229"]
    [37.187.66.229] executing command
    command finished in 113ms
    failed: "sh -c 'sh -c '\\''cd /usr/share/nginx/www/stackexchange/releases/20130820143357 && php ./symfony cache:clear'\\'''" on 37.187.66.229

自从我没有使用 capifony 以来已经很长时间了,但我从来没有遇到过这种错误。我重复使用相同的文件,但我肯定会错过一些东西。提前致谢 :)

我的部署文件是这样的:

# setup server
set     :application,   "Stackexchange Network"
set     :domain,        "37.187.66.229"
set     :deploy_to,     "/usr/share/nginx/www/stackexchange"

role    :web,           domain
role    :app,           domain


# git configuration
set     :scm,           :git
set     :branch,        "master"
set     :repository,    "file:///Applications/MAMP/htdocs/6.symfony_project/stackexchange"
set     :deploy_via,    :copy
ssh_options[:forward_agent] = true


# ssh log
set     :user,          "user"
set     :password,      "password"

set     :use_sudo,      false
set     :keep_releases, 3
default_run_options[:pty] = true


# Symfony2 configuration
set     :clear_controllers,         true
set     :controllers_to_clear,      ['app_*.php']
set     :model_manager,             "doctrine"
set     :use_orm,                   false
set     :shared_files,              ["app/config/parameters.yml"]
set     :shared_children,           ["app/logs", "app/cache"]

set     :use_composer,              true
set     :update_vendors,            true
set     :dump_assetic_assets,       true


set     :writable_dirs,             ["app/cache", "app/cache/prod", "app/cache/dev",    "app/logs", "vendor"]
set     :webserver_user,            "www-data"
set     :permission_method,         :chown
set     :use_set_permissions,       true

before 'symfony:composer:update', 'symfony:copy_vendors'
after 'symfony:cache:warmup', 'deploy:cleanup'

  namespace :symfony do
    desc "Copy vendors from previous release"
    task :copy_vendors, :except => { :no_release => true } do
      if Capistrano::CLI.ui.agree("Do you want to copy last release vendor dir then do composer install ?: (y/N)")
        capifony_pretty_print "--> Copying vendors from previous release"

        run "cp -a #{previous_release}/vendor #{latest_release}/"
        capifony_puts_ok
     end
   end
 end

 # logger.level = Logger::INFO
 # Be more verbose by uncommenting the following line
 logger.level = Logger::MAX_LEVEL
4

1 回答 1

2

你可能Capfile为 symfony 1.x生成了。

Symfony2Capfile应该如下所示(这是 capifony 2.3.0 为我生成的):

load 'deploy' if respond_to?(:namespace) # cap2 differentiator

require 'capifony_symfony2'
load 'app/config/deploy'

如果您想从头开始,请尝试在设置项目时强制使用 Symfony 版本:

capifony -s 2 .
于 2013-08-20T15:10:32.243 回答