Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Error on deploy:assets:precompile task. #224

rtdp opened this Issue · 8 comments

6 participants

Ratnadeep Deshmane Simon Harrer Paul A Jungwirth Roy Liu James EdJo Michael Guymon
Ratnadeep Deshmane

I have a newly deploy rails app. Just done with cap staging deploy:setup.

Now when I try deploying this app with cap staging deploy it gives error as -

  * executing `deploy:assets:precompile'
  * executing "cat /var/www/new/myapp/current/REVISION"
    servers: [""]
    [] executing command
[err ::] cat: /var/www/new/myapp/current/REVISION
[err ::] : No such file or directory

While this same setup works for production environment. While debugging I just removed load deploy/assets line from deploy.rb file. Tried redeploying, which worked.

Now, if I again add load deploy/assets then it works again as expected.

So, I guess, there is issue with deploy/assets recipes which causes it to fail for first deploy after deploy:setup.

Simon Harrer

I do have the same issue and used the same workaround.

Paul A Jungwirth

I have this same problem: No current directory the first time I try to deploy. Although there's a workaround, this messes up automation, e.g. deploying to new instances.

Roy Liu

All, what version of Capistrano is this?

Paul A Jungwirth

I eventually figured out this was because I had redefined the deploy:assets:precompile task to run from current, not releases/12345. Removing my custom task definition fixed the problem for me. I have a feeling a lot of people may have done this in the early days of the asset pipeline to get RAILS_GROUPS=assets into the command string. Here is a relevant StackOverflow question:

Roy Liu

@pjungwir Thanks for sharing! Closing the issue...

Roy Liu carsomyr closed this
Ratnadeep Deshmane

I used to do asset compilation via deploy/assets script only, without any custom precompile task.
moved to heroku and dont have this setup, so can't reproduce / test.

James EdJo

The assets:precompile code I was using had the same problem. Easy workaround

def assets_changed
    from = source.next_revision(current_revision)
    return capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ lib/assets/ | wc -l").to_i > 0
    return true #no current revision
Michael Guymon

@Jamedjo: Solution worked great for me +1

Corey Grusden cgrusden referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.