Topic: why doesnt 'current' symlink include the public folder?

Hi, using capistrano, why doesnt the generated symlink 'current' point to the public directory in my rails project, and is it possible to make it point there?

I have found very little information regarding the directory structure you should adopt on the server, i partially followed a tutorial about deployment onto dreamhost, and it said you should change your webroot to ........current/public, but i dont have that facility on my host.

please help, cheers

Re: why doesnt 'current' symlink include the public folder?

You can use this syntax at the command line to create the symlink you desire:

ln -s {path} {symbol}
ie. -> ln -s /home/{username}/www.you.com/public current

You need to be in the directory that you would like this symlink created in in order to do it.

Use this to delete one that already exists:

find . -maxdepth 1 -type l -exec rm -f {} \;

If you would like to change your deploy.rb file to do this for you, you can create a task that has these lines in it:

run "find #{deploy_to}/current -maxdepth 1 -type l -exec rm -f {} \;" #removing symlink
run "ln -s #{release_path}/public #{deploy_to}/current" #creating symlink

Hopefully all of my syntax is correct!

Re: why doesnt 'current' symlink include the public folder?

Thats great, just what i was looking for, thanks.