Capistrano: deploy files other than used in development
===

I have a rails application that uses some bash scripts that have different values (paths) in them for development and production. I want to use capistrano to deploy the app using the values suitable for production.
So for example in #{Rails.root}+'script.sh':

     #!/bin/bash
     /usr/local/bin/convert  -colorspace sRGB -background transparent -font Myriad-Pro-Condensed -fill grey0 -stroke yellow -strokewidth 2 -size 640x480 -gravity $3 label:"$2" $1.png


For production I will need:

     #!/bin/bash
     /usr/bin/convert  -colorspace sRGB -background transparent -font Myriad-Pro-Condensed -fill grey0 -stroke yellow -strokewidth 2 -size 640x480 -gravity $3 label:"$2" $1.png

Is there a solution which involves changing files on the fly, while deploying (with some gsub command, that changes values)? 