Forum: Ruby on Rails Capistrano :update_code problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Henry T. (Guest)
on 2006-03-16 17:24
(Received via mailing list)
Hi all,

I want to love capistrano and I'm so close.

My error is occuring while running the update_code task... (apologies
for the shell spew)

*************************************************************************
* executing "rm -rf
/home/henster29/sites/glitter/releases/20060316143447/log
/home/henster29/sites/glitter/releases/20060316143447/public/system
&&\n    ln -nfs /home/henster29/sites/glitter/shared/log
/home/henster29/sites/glitter/releases/20060316143447/log &&\n    ln
-nfs /home/henster29/sites/glitter/shared/system
/home/henster29/sites/glitter/releases/20060316143447/public/system"
   servers: ["aidlife.textdriven.com"]
   [aidlife.textdriven.com] executing command
 ** [out :: aidlife.textdriven.com] ln:
/home/henster29/sites/glitter/releases/20060316143447/public/system:
No such file or directory
   command finished
*************************************************************************

Ah, so its trying to make a symbolic link to a dir that doesnt exist...
I checked the gems/capistrano-1.1.0/lib/capistrano/recipes/standard.rb
which seems to be the source and found this..

*************************************************************************
task :update_code, :roles => [:app, :db, :web] do
 on_rollback { delete release_path, :recursive => true }

 source.checkout(self)

 run <<-CMD
   rm -rf #{release_path}/log #{release_path}/public/system &&
   ln -nfs #{shared_path}/log #{release_path}/log &&
   ln -nfs #{shared_path}/system #{release_path}/public/system
 CMD
end
**************************************************************************

Which looks like (to me) that it blows away
#{release_path}/public/system and then tries to make a link in there.

I must be talking crap since this works for everyone else... Any ideas?

Thanks
-henry
Jamis B. (Guest)
on 2006-03-16 18:03
(Received via mailing list)
Henry,

Did you set up your machines using the 'setup' task, or did you build
the directories manually?

The directory structure ought to look like this:

   /deploy_to
   /deploy_to/releases
   /deploy_to/releases/...
   /deploy_to/shared
   /deploy_to/shared/log
   /deploy_to/shared/system
   /deploy_to/current -> /deploy_to/releases/...

- Jamis
Ray B. (Guest)
on 2006-03-16 20:01
(Received via mailing list)
Henry T. wrote:

> My error is occuring while running the update_code task... (apologies
> for the shell spew)

Shell spew is helpful. Give us more!

>  ** [out :: aidlife.textdriven.com] ln:
> task :update_code, :roles => [:app, :db, :web] do
>  on_rollback { delete release_path, :recursive => true }
>
>  source.checkout(self)
>
>  run <<-CMD
>    rm -rf #{release_path}/log #{release_path}/public/system &&

If you want to trouble shoot this, change the rm -rf to rm -r. Then if
the #{release_path}/log or #{release_path}/public/system do not exist,
you will get an error. The -f option causes rm not to complain about
directories that don't exist, in addition to forcing removal of files
that have restrictive permissions.

As Jamis points out in a parallel response, if you run the setup tasks
these directories should have been created, but is possible that they
don't.

Ray
Henry T. (Guest)
on 2006-03-16 22:50
(Received via mailing list)
Thanks for the help guys, you led me down the right track.

I was trying to deploy a single file,"test.txt", to see if I could get
it to work... rather than a whole rails app.
/deploy_to/releases/public isnt made in setup but rather checked out
from your repos. So public wasnt there.. Oops.

It might be nice to have /deploy_to/releases/public created during
setup... but I may be in the minority using full blown capistrano to
upload a text file ;)

beers
-h
This topic is locked and can not be replied to.