2013-03-27 132 views
3

我想我的Symfony2的應用程序部署到其外部託管,使用capifony我的開發服務器,但我發現了以下錯誤:Capifony高速緩存錯誤

--> Updating code base with remote_cache strategy 
--> Creating cache directory................................✔ 
--> Creating symlinks for shared directories................✔ 
--> Creating symlinks for shared files......................✔ 
--> Copying Composer from previous release..................✔ 
--> Updating Composer.......................................✔ 
--> Updating Composer dependencies..........................✔ 
--> Building bootstrap file.................................✔ 
--> Dumping an optimized autoloader.........................✔ 
--> Installing bundle's assets..............................✔ 
--> Warming up cache........................................✔ 
--> Dumping all assets to the filesystem....................✘ 
*** [err :: x.xx.xx.xxx] PHP Fatal error: Class 'Ivory\GoogleMap\Templating\Helper\Base\CoordinateHelper' not found in /var/www/dev.xyz.co.uk/shared/app/cache/dev/appDevProjectContainer.php on line 462 

上午我從我的部署腳本丟失了什麼?這裏是我的deploy.rb文件:

set :stage_dir, 'app/config/deploy' # needed for Symfony2 only 
set :stages, %w(production staging development) 
require 'capistrano/ext/multistage' 

set :application,   "xyz.co.uk" 
set :user,     "root" # The server's user for deploys 

set :normalize_asset_timestamps, false 

set :repository,   "[email protected]:xyz/xyz.co.uk.git" 
set :scm,     :git 
set :keep_releases,   3 
set :use_sudo,    false 
set :shared_files,   ["app/config/parameters.yml"] 
set :web_path,    "web" 
set :shared_children,  [app_path + "/logs", app_path + "/cache", web_path + "/uploads", "vendor"] 
set :use_composer,   true 
set :update_vendors,  true 
set :dump_assetic_assets, true 
set :deploy_via,   :remote_cache 

#logger.level = Logger::MAX_LEVEL 

這裏是我的development.rb文件:

server 'x.xx.xx.xxx', :app, :web, :db, :primary => true 
ssh_options[:port] = xxxx 
ssh_options[:forward_agent] = true 
set :deploy_to, "/var/www/dev.xyz.co.uk" 
set :symfony_env_prod, "dev" 
set :branch, "develop" 

# Need to clear *_dev controllers 
set :clear_controllers,  false 
+0

我必須在部署之前刪除緩存,然後才能工作。我應該在部署腳本中添加一個掛鉤來清除緩存嗎? – user1961082 2013-03-27 10:58:23

回答

3

版本之間你不應該共享app/cache。像這樣保持:

set :shared_files,  ["app/config/parameters.yml"] 
set :shared_children,  [app_path + "/logs", web_path + "/uploads"] 
+0

確定並刪除「供應商」?我現在就試試看。 – user1961082 2013-03-27 12:37:45

+0

部署時,我的緩存目錄仍然存在問題。我得到錯誤'RuntimeException:無法寫入緩存文件「/var/www/xyz.co.uk/app/cache/dev/classes.php」.',除非我刪除所有緩存,那麼它工作正常。任何想法爲什麼這是?我沒有像/app/logs/ – user1961082 2013-03-27 12:49:19

+0

這樣的app/cache/symlinked你不應該符號鏈接'app/cache',因爲每個版本都有它自己的代碼並且需要清除緩存,所以這很好。您的問題與權限有關,您必須按照此處所述設置權限 - http://symfony.com/doc/current/book/installation.html#configuration-and-setup。最簡單的方法是將'umask(0000);'添加到'app/console'和'web/app * .php'。 – 2013-03-27 20:46:48