capifony think i'm using Symfony 1

343 Views Asked by At

i'm trying to deploy a new site and i don't understand why i have some weird errors.

My first error is:

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'

I don't understand why capifony asking me for database.yml which is a file for Symfony 1 (i think)

So i put : set:use_orm, false (as the documentation say for symfony1 project) and it works but now i have a new error which is :

  * 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

It's been a long time since i didn't use capifony but i never have this kind of error. I reuse the same file but i certainly miss something. Thanks in advance :)

My deploy file is like this :

# 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
1

There are 1 best solutions below

1
On BEST ANSWER

You probably generated the Capfile for symfony 1.x.

Symfony2 Capfile should look something like the following (this is what capifony 2.3.0 generated for me):

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

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

If you want to start from the beginning, try forcing Symfony version when capifying your project:

capifony -s 2 .