If you are using cap more or less out of the box with a default deploy script, 
you problem is likely one of release management.

By default, cap sets up a directory structure of:

/app
 /shared
 /releases
 /current (symlink to a folder in /releases)

When you do a deployment, a new folder is setup in /releases and the /current 
symlink is repointed. The problem I think your facing is that nginx is pointing 
at the directory for release n, while the image you uploaded in now in the 
release n-1 directory. The general solution is to create a directory in the 
/shared folder that stores assets *not* found in version control that you want 
to share between releases. Symlink that into your current directory so that 
uploads end up in shared and are always available between releases.

Lots of different ways to setup that symlink, but it's generally done by your 
deploy.rb file in a manner similar to how the database.yml file is linked.

-Sean

On Monday 27 July 2009 03:14:38 am merbivore wrote:
> 
> Hello,
> 
>   Am facing a weird issue with merb and nginx. i tried my best to
> solve that , but couldn't able to do that.
> 
> i can able to upload images in my application. i have specified the
> path as   public/teachers/hostel_staff
> am saving the images in hostel_staff directory.
> 
> when i made a deploy ment using capistrano or vlad in my server, i
> cant able to see the uploaded images in my site. again i have to go to
> edit and upload a new image then i can able to see the image.
> 
> I have provided my ngin config as
> 
>    location / {
>                  # doc root
>                   root /home/eshwar/schoolapp/current/generic/public;
>       }
> 
> this is my code for displaying image in the view
> 
>    <img src= "/teachers/hostel_staff/<%= @attachment.filename %>"
> alt="<%= @attachment.filename %>", class = "prinPic"/>
> 
> can i have some suggestions regarding this issues..
>  Am struck with this issue.
> 
> 
> > 
> 

-- 
Sean Kellogg
e: [email protected]
w: http://blog.probonogeek.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to