I  think, if I'm understanding your situation correctly, you want to
symlink your user image directories into somewhere under your "/home/
#{user}/public/#{application}/shared" directory.

The "shared" directory created by capistrano on your staging server
does not change from release to release.  Create that directory on
your local dev box and make sure that path is the same as on the
staging serve.  Then on both your dev and staging boxes create
subdirectories under that perhaps "shared/images/users".  Remove the
existing "/public/images/users" then symlink to the shared directory
(from your public/images directory just do: "ln -s /home/#{user}/
public/#{application}/shared/images/users users" in case your not
familiar).

I haven't used git but I would assume that it can version symlinks.

Hope that helps!
Tim

On Nov 1, 10:13 am, Tony Tony <[EMAIL PROTECTED]>
wrote:
> Hi guys,
>
> So I finally got around to setting up a staging server (ubuntu + apache
> + passenger) and after some headaches got Capistrano (using git as the
> scm) to deploy the app to my staging server using a basic deploy.rb
> file. Everything seems to be working well, any changes I commit and
> deploy take effect.
>
> HOWEVER, I am storing user pictures using the paperclip plugin to the
> staging server filesystem (rails_root/public/images/users/). After
> creating some users and uploading their pictures (on the staging
> server), I decided to deploy some changes I made to the app only to find
> out that my user pictures we're overwritten with my local (development)
> user image folder.
>
> I rolled back the deployment and all the pictures were displayed like
> they were previously (on the staging server)
>
> So I added the following line to the .gitignore file to my local
> (development) machine:
>
> [code]
> public/images/users/*
> [/code]
>
> I committed the change and deployed but again, the local development
> machine's user image folder replaces the staging server user image
> folder contents.
>
> Below is my deploy.rb file contents (edited):
>
> [code]
>
> set :application, "staging.domain.com"
> set :repository,  "."
>
> set :rails_env, "staging"
> set :user, "user"
> set :deploy_to, "/home/#{user}/public/#{application}"
> set :use_sudo, true
>
> set :scm, :git
> set :deploy_via, :copy
> set :copy_remote_dir, "/home/#{user}"
>
> role :app, application
> role :web, application
> role :db,  application, :primary => true
>
> namespace :deploy do
>   desc "Restarting mod_rails with restart.txt"
>   task :restart, :roles => :app, :except => { :no_release => true } do
>     run "touch #{current_path}/tmp/restart.txt"
>   end
>   [:start, :stop].each do |t|
>     desc "#{t} task is a no-op with mod_rails"
>     task t, :roles => :app do ; end
>   end
> end
>
> [/code]
>
> I'm pretty much stumped on this. Also, I realize doing a full copy every
> time to the server isn't the best thing to do, but it's the only way I
> can (currently) get it to work. I'm still pretty new at this
> rails/scm/terminal world. ;-)
>
> Let me know if you need any more info or code from my end that may help.
>
> Thanks for any advice or suggestions!
>
> -Tony
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to