Topic: Paperclip failing in production
I am using Paperclip to let users upload PDFs. In development, it works fine, but in production, it fails to retrieve the uploaded files. There seems to be two different problems here.
The first is the "url" method. It misses the context for the project. That is fine in development, Webrick has no context, but in production on Tomcat, it fails.
So for example:
The code I am using to generate the URL is this:
<%= link_to 'Certificate', record.certificate.url(:original, false) %>
The second problem appears if I type in the context by hand; I still do not get the uploaded file returned. Paperclip has successfully uploaded it, eg:
But Rails is refusing to serve it, as it is looking for this:
Running on Rails version 3.2.11, with Ruby 1.9.3, on JRuby 1.7.2, using Tomcat, on Windows.
Any advice gratefully received!
Last edited by F2Andy (2013-02-19 10:28:00)