3

I am migrating a Rails application I created a few years ago and did not deploy it for a long time to a new server. At the time, I used capistrano with no problems and now, when I run cap deploy I get the following step failed:

  * executing "ls -1 /home/deploy/mywebsite.com/shared/assets/.sprockets-manifest* | wc -l"
    servers: ["45.79.142.32"]
    [45.79.142.32] executing command
    command finished in 727ms
  * executing "ls /home/deploy/mywebsite.com/shared/assets/.sprockets-manifest*"
    servers: ["45.79.142.32"]
    [45.79.142.32] executing command
    command finished in 783ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/deploy/mywebsite.com/releases/20150812101128; true"
    servers: ["45.79.142.32"]
    [45.79.142.32] executing command
    command finished in 944ms
failed: "rvm_path=/home/deploy/.rvm /home/deploy/.rvm/bin/rvm-shell 'ruby-2.2.2' -c 'ls /home/deploy/mywebsite.com/shared/assets/.sprockets-manifest*'" on 45.79.142.32

I read in a few places about sprockets changing the manifest file name or type (from .sprockets-manifest to .manifest or something), but I have no idea of how to solve it in a way that it isn't a hack. I am not sure if this is due to using old Rails version or something. This are the versions I am using:

  • Ruby 2.2.2
  • Rails 3.2.14
  • Capistrano 2.15.6 (with Rvm/capistrano)
  • Sprockets 2.2.1
Bruno Siqueira
  • 860
  • 11
  • 25

2 Answers2

6

The solution was ridiculous. Searching the web, I found out that sprockets was looking for the .sprockets-manifest.json file. Which didn't exist (and this I don't know why). So I just created it manually in the shared/assets folder:

touch shared/assets/.sprockets-manifest.json

It worked like a charm. Hope this helps others.

Bruno Siqueira
  • 860
  • 11
  • 25
0

Your sprockets version may differ from this Gemfile

Can try add bundle exec prefix use Gemfile specifies the versions

I find capistrano 2.15.7 source code found this

# lib/capistrano/recipes/deploy/assets.rb

_cset(:asset_manifest_prefix) { (`sprockets -v`.chomp < "3.0" ? "manifest" : ".sprockets-manifest") rescue "manifest" }

See more on What does bundle exec rake mean?