2012-02-27 15 views
12

No estoy seguro de entender los mensajes de error que recibo al intentar implementar mi aplicación de rieles con capistrano. La implementación está fallando debido a que falta un directorio (más específicamente: imágenes, hojas de estilo y javascript) pero no estoy seguro de por qué se están buscando estos directorios en el directorio público del directorio de versiones. Estas carpetas deberían estar en el directorio de activos de mi directorio de aplicaciones, pero ¿capistrano está buscando en la carpeta pública de la carpeta de lanzamiento de/images,/stylesheets y/javascript? ¿Alguna idea de por qué? ¿Alguna idea de lo que estoy haciendo mal? ¡Cualquier ayuda sería muy apreciada! La salida del terminal está abajo.Faltan errores de carpeta durante la implementación de capistrano

user-MacBook-Pro:projectfolder myuser$ cap deploy 
    * executing `deploy' 
    * executing `deploy:update' 
** transaction: start 
    * executing `deploy:update_code' 
    updating the cached checkout on all servers 
    executing locally: "git ls-remote ssh://[email protected]/usr/local/git_root/project.git master" 
    command finished in 1700ms 
    * executing "if [ -d /usr/local/www/sites/project.example.ca/public/shared/cached-copy ]; then cd /usr/local/www/sites/project.example.ca/public/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 9d2c784bafe0f8bd15f831f2ec722b215191e6fa && git clean -q -d -x -f; else git clone -q ssh://[email protected]/usr/local/git_root/project.git /usr/local/www/sites/project.example.ca/public/shared/cached-copy && cd /usr/local/www/sites/project.example.ca/public/shared/cached-copy && git checkout -q -b deploy 9d2c784bafe0f8bd15f831f2ec722b215191e6fa; fi" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'if [ -d /usr/local/www/sites/project.example.ca/public/shared/cached-copy ]; then cd /usr/local/www/sites/project.example.ca/public/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 9d2c784bafe0f8bd15f831f2ec722b215191e6fa && git clean -q -d -x -f; else git clone -q ssh://[email protected]/usr/local/git_root/project.git /usr/local/www/sites/project.example.ca/public/shared/cached-copy && cd /usr/local/www/sites/project.example.ca/public/shared/cached-copy && git checkout -q -b deploy 9d2c784bafe0f8bd15f831f2ec722b215191e6fa; fi' 
    command finished in 1344ms 
    copying the cached version to /usr/local/www/sites/project.example.ca/public/releases/20120225025005 
    * executing "cp -RPp /usr/local/www/sites/project.example.ca/public/shared/cached-copy /usr/local/www/sites/project.example.ca/public/releases/20120225025005 && (echo 9d2c784bafe0f8bd15f831f2ec722b215191e6fa > /usr/local/www/sites/project.example.ca/public/releases/20120225025005/REVISION)" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'cp -RPp /usr/local/www/sites/project.example.ca/public/shared/cached-copy /usr/local/www/sites/project.example.ca/public/releases/20120225025005 && (echo 9d2c784bafe0f8bd15f831f2ec722b215191e6fa > /usr/local/www/sites/project.example.ca/public/releases/20120225025005/REVISION)' 
    command finished in 945ms 
    * executing `deploy:finalize_update' 
    * executing "chmod -R g+w /usr/local/www/sites/project.example.ca/public/releases/20120225025005" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'chmod -R g+w /usr/local/www/sites/project.example.ca/public/releases/20120225025005' 
    command finished in 921ms 
    * executing "rm -rf /usr/local/www/sites/project.example.ca/public/releases/20120225025005/log /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/system /usr/local/www/sites/project.example.ca/public/releases/20120225025005/tmp/pids &&\\\n  mkdir -p /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public &&\\\n  mkdir -p /usr/local/www/sites/project.example.ca/public/releases/20120225025005/tmp" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'rm -rf /usr/local/www/sites/project.example.ca/public/releases/20120225025005/log /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/system /usr/local/www/sites/project.example.ca/public/releases/20120225025005/tmp/pids &&\ 
    [project.example.ca] mkdir -p /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public &&\ 
    [project.example.ca] mkdir -p /usr/local/www/sites/project.example.ca/public/releases/20120225025005/tmp' 
    command finished in 920ms 
    * executing "ln -s /usr/local/www/sites/project.example.ca/public/shared/system /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/system" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'ln -s /usr/local/www/sites/project.example.ca/public/shared/system /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/system' 
    command finished in 922ms 
    * executing "ln -s /usr/local/www/sites/project.example.ca/public/shared/log /usr/local/www/sites/project.example.ca/public/releases/20120225025005/log" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'ln -s /usr/local/www/sites/project.example.ca/public/shared/log /usr/local/www/sites/project.example.ca/public/releases/20120225025005/log' 
    command finished in 920ms 
    * executing "ln -s /usr/local/www/sites/project.example.ca/public/shared/pids /usr/local/www/sites/project.example.ca/public/releases/20120225025005/tmp/pids" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'ln -s /usr/local/www/sites/project.example.ca/public/shared/pids /usr/local/www/sites/project.example.ca/public/releases/20120225025005/tmp/pids' 
    command finished in 922ms 
    * executing "find /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/images /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/stylesheets /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/javascripts -exec touch -t 201202250250.11 {} ';'; true" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] env TZ=UTC rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'find /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/images /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/stylesheets /usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/javascripts -exec touch -t 201202250250.11 {} '\'';'\''; true' 
*** [err :: project.example.ca] find: 
*** [err :: project.example.ca] `/usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/images' 
*** [err :: project.example.ca] : No such file or directory 
*** [err :: project.example.ca] 
*** [err :: project.example.ca] find: 
*** [err :: project.example.ca] `/usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/stylesheets' 
*** [err :: project.example.ca] : No such file or directory 
*** [err :: project.example.ca] 
*** [err :: project.example.ca] find: 
*** [err :: project.example.ca] `/usr/local/www/sites/project.example.ca/public/releases/20120225025005/public/javascripts' 
*** [err :: project.example.ca] : No such file or directory 
*** [err :: project.example.ca] 
    command finished in 1027ms 
    * executing `deploy:create_symlink' 
    * executing `deploy:symlink' 
[Deprecation Warning] This API has changed, please hook `deploy:create_symlink` instead of `deploy:symlink`. 
    * executing "rm -f /usr/local/www/sites/project.example.ca/public/current && ln -s /usr/local/www/sites/project.example.ca/public/releases/20120225025005 /usr/local/www/sites/project.example.ca/public/current" 
    servers: ["project.example.ca"] 
    [project.example.ca] executing command 
    [project.example.ca] rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell '[email protected]' -c 'rm -f /usr/local/www/sites/project.example.ca/public/current && ln -s /usr/local/www/sites/project.example.ca/public/releases/20120225025005 /usr/local/www/sites/project.example.ca/public/current' 
    command finished in 814ms 
** transaction: commit 
    * executing `deploy:restart' 

Respuesta

31

Añadir set :normalize_asset_timestamps, false a su archivo de despliegue. Por defecto está configurado en verdadero y ejecuta un comando táctil en todas sus imágenes/javascripts/hojas de estilo, pero ya no es necesario si está utilizando la canalización de activos.

+0

Impresionante. Gracias. ¡Eso resolvió la mayoría de los errores! ¿Sabes cómo debo resolver el error de enlace simbólico? [Advertencia de preprocesamiento] Esta API ha cambiado, enganche 'deploy: create_symlink' en lugar de' deploy: symlink'. –

+0

Publique su archivo de implementación. – James

+0

Mi archivo de implementación parece ser demasiado largo para el cuadro de comentarios, y no puedo responder a mi pregunta por otras 7 horas, así que lo publiqué aquí: http://stackoverflow.com/questions/9469456/symlink-error- during-rails-app-deploy-with-capistrano –

Cuestiones relacionadas