In one of my recent Rails3 projects I implemented a download possibility with the "send_file" method. It worked fine in development mode, but after deploying the app it did not work anymore. The result always was an 0 byte file. The downloaded file always was blank.
My solution for this problem:
I just uncomment the following line in config/environments/production.rb
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
I think it depends which server type (linux, debian, windows, etc.) you use in your background, but this was the solution for me. By the way I am using a linux server in this case.
It is just really simple, but maybe you save some time through this short blogpost :-).