0

I have an application that is being upgraded from Rails 3 to Rails 4 and everything is working fine in development on a Windows 7 box. However, when I try to test production on a CentOS 5.10 virtual machine the images are broken. Firefox displays, "The image cannot be displayed because it contains errors" and Chrome just appears blank. When I use curl I get the following information:

HTTP/1.1 200 OK
Date: Tue, 03 Jun 2014 20:36:44 GMT
Server: Apache/2.2.3 (CentOS)
Cache-Control: public, must-revalidate
ETag: "6fda96e78f0677973258d551e4c1a95e"
X-Request-Id: 6ae8054b-8756-4ab1-906f-10ce13da31ed
X-Runtime: 0.004431
X-Sendfile: /home/foo/app/assets/images/loading.gif
X-Powered-By: Phusion Passenger 4.0.41
Content-Length: 0
Last-Modified: Mon, 02 Jun 2014 20:38:10 GMT
Status: 200 OK
Connection: close
Content-Type: image/gif

As you can see I am using Phusion Passenger 4.0.41 on Apache 2.2.3. CentOS is version 5.10. I also double checked that mod_xsendfile was indeed installed, and it was.

I've tried everything that they suggested on GitHub with no success.

My logs just say Started GET "asset-files/loading.gif for 10.0.0.187 at 2014-06-03 -0600 (Note the assets was changed to asset-files due to a conflicting model named asset from the Rails 2 days).

I did precompile my assets also. As well as delete the cache. Any ideas?

Travis Pessetto
  • 3,260
  • 4
  • 27
  • 55

1 Answers1

0

I finally found a good StackOverflow post on it, which can be found on Images and assets not working in my production server on rails 3.1.0.

Basically, I had to add the following two lines to my config/enviornments/production.rb file:

config.assets.compile = false
config.assets.digest = true

Then I compiled the assets again and restarted the application and it now appears to be working.

Community
  • 1
  • 1
Travis Pessetto
  • 3,260
  • 4
  • 27
  • 55