문제

I have production Rails 3.2.3 application which I use to deploy using capistrano. When I decided to upgrade rails to 3.2.11 i did following steps:

  1. changed rails version in Gemfile
  2. run "bundle update rails"
  3. pushed new gems from vendor/cache, Gemfile and Gemfile.lock
  4. run "cap production deploy"

Capistrano now fails with error:

  * 2013-01-11 15:58:25 executing `deploy:assets:precompile'
    triggering before callbacks for `deploy:assets:precompile'
  * 2013-01-11 15:58:25 executing `deploy:assets:update_asset_mtimes'
  * executing "[ -e /home/deploy/projects/otv/shared/assets/manifest.yml ] && cat /home/deploy/projects/otv/shared/assets/manifest.yml || echo"
    servers: ["xxx.xxx.99.51"]
    [xxx.xxx.99.51] executing command
    command finished in 28ms
  * executing "cd -- /home/deploy/projects/otv/releases/20130111095812 && export LANG=en_US.UTF-8 && /usr/local/bin/bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile && cp -- /home/deploy/projects/otv/shared/assets/manifest.yml /home/deploy/projects/otv/releases/20130111095812/assets_manifest.yml"
    servers: ["xxx.xxx.99.51"]
    [xxx.xxx.99.51] executing command
 ** [out :: xxx.xxx.99.51] cp: cannot stat ‘/home/deploy/projects/otv/shared/assets/manifest.yml’: No such file or directory
    command finished in 18773ms

I tried to perform these steps with other project which previously successfully used to be deployed with capistrano with the same result.

My Gemfile and deploy.rb

도움이 되었습니까?

해결책

FWIW, I was getting this after updating Capistrano to > 2.14.0:

*** [err :: ourapp.net] cp: cannot stat `/home/deploy/www/ourapp/shared/assets/manifest.yml'
*** [err :: ourapp.net] : No such file or directory

I think symlinking the assets to the shared dir would fix it, but instead of messing around (gotta get this deploy out), I just downgraded cap back to 2.13.5.

다른 팁

I had the same issue.

New versions of capistrano now have some code to handle the shared assets path symlinking. My config/deploy.rb had some code to handle this, and the paths were conflicting with each other. I just removed this line from it to solve the problem:

run "ln -nfs #{shared_path}/public/assets #{release_path}/public/assets"

did you delete all your assets on your distant server before to upgrade?

Sometimes some old references could cause that kind of issue

Cheers, Jérémy

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top