Search code examples
ruby-on-railsamazon-web-servicescapistrano

Public assets with Capistrano and Rails not being uploaded


I have several sounds files that are located in public/assets/sounds.

Locally everything works fine, but when I deploy via Capistrano to my ec2 instance, none of those assets make it to the server. I added 'public/assets/sounds' to :linked_dirs in deploy.rb. A directory shows up at 'public/assets/sounds' but none of the mp3s are there. Do I need to manually add all files via :linked_files?

I have it working by just loading the files into the shared/public/assets/sounds directory via ftp, but that doesn't seem like the best use of the Capistrano. I'm also new to Capistrano and could be totally wrong :p


Solution

  • The public/assets directory is reserved for the Rails asset pipeline. You should not place any files there. Here's what I would do:

    1. Remove public/assets/sounds from :linked_dirs.
    2. Choose a different place for the mp3 files, like public/sounds.
    3. Do not add this directory to :linked_dirs.