Actually, "current_release" is correct. If you look at the definition
for current_release:
_cset(:current_release) { File.join(releases_path, releases.last) }
Which returns the path of the last release in the releases directory:
_cset(:releases) { capture("ls -xt #{releases_path}").split.reverse }
Now, it could be that you've got a before() hook somewhere that is
calling (directly or indirectly) the releases variable, before the new
release is uploaded. In that case, Capistrano is caching the
pre-new-code value. You could try something like this to make sure
you're getting the right version:
before("deploy:migrate") { reset! :releases }
Calling reset! forces Capistrano to forget the cached value, so that the
next query for the releases variable will go and fetch the directory
list again from the server.
- Jamis