我正在尝试部署一个新网站,我不明白为什么我会有一些奇怪的错误。
我的第一个错误是:
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,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
答案 0 :(得分:2)
您可能为symfony 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版本:
capifony -s 2 .