2013-08-20 42 views
0

我試圖部署一個新的網站,我不明白爲什麼我有一些奇怪的錯誤。capifony認爲我使用Symfony 1

我的第一個錯誤是:

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文件(我認爲)

所以我把: 集:use_orm,假(如文檔說的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 
+0

嘗試更新資源寶石gem update capifony –

+0

感謝您的建議。我已經更新到capifony 2.3.0,但沒有任何變化。我仍然有同樣的錯誤。 – Epok

回答

2

你可能爲symfony1.2 1.x中產生的Capfile

Symfony2的Capfile看起來應該像下面的(這是capifony對我產生2.3.0):

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

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

如果你想從頭開始,請嘗試強制Symfony的版本capifying項目時:

capifony -s 2 . 
+0

非常感謝,就是這樣。我從不看這個文件的內容。 – Epok