<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - Paperclip failing in production]]></title>
		<link>http://railsforum.com/viewtopic.php?id=53194</link>
		<description><![CDATA[The most recent posts in Paperclip failing in production.]]></description>
		<lastBuildDate>Tue, 19 Feb 2013 14:24:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Paperclip failing in production]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=160116#p160116</link>
			<description><![CDATA[<p>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.</p><p>The first is the &quot;url&quot; method. It misses the context for the project. That is fine in development, Webrick has no context, but in production on Tomcat, it fails.</p><p>So for example:</p><p>http://[prod-server]:9090/system/training_log/events/certificates/000/011/883/original/EFAA_GLC.pdf</p><p>Should be:</p><p>http://[prod-server]:9090/[my-context]/system/training_log/events/certificates/000/011/883/original/EFAA_GLC.pdf</p><p>The code I am using to generate the URL is this:</p><p>&lt;%= link_to &#039;Certificate&#039;, record.certificate.url(:original, false) %&gt;</p><br /><br /><br /><br /><p>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:</p><p>C:\apache-tomcat-6.0.32\webapps\[my-context]\WEB-INF\public\system\training_log\events\certificates\000\011\883\original\EFAA_GLC.pdf</p><p>But Rails is refusing to serve it, as it is looking for this:</p><p>C:\apache-tomcat-6.0.32\webapps\[my-context]\system\training_log\events\certificates\000\011\883\original\EFAA_GLC.pdf</p><br /><br /><br /><p>Running on Rails version 3.2.11, with Ruby 1.9.3, on JRuby 1.7.2, using Tomcat, on Windows.</p><br /><p>Any advice gratefully received!</p>]]></description>
			<author><![CDATA[dummy@example.com (F2Andy)]]></author>
			<pubDate>Tue, 19 Feb 2013 14:24:38 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=160116#p160116</guid>
		</item>
	</channel>
</rss>
