Reputation: 1985
I've added some new images to my app and they display fine locally, but not in production on Heroku. The CSS reference that is generated is correct:
background-image: url("glyphicons-halflings-white.png")
That ultimately links to http://www.photoramblr.com/assets/glyphicons-halflings-white.png
There's no image there, but other images I've uploaded in the past are sitting there under /assets/... For instance this one. Interestingly, if I take the long string of numbers out, leaving just the original filename, the image is blank...
Asset precompiling seemed to work fine when deploying, and I've just tried running asset:precompile manually on the server, but still no image.
Any thoughts?
UPDATE: BTW, here's a look at my config/application.rb
:
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
# Bundler.require *Rails.groups(:assets => %w(development test))
# If you want your assets lazily compiled in production, use this line
Bundler.require(:default, :assets, Rails.env)
end
module PhotoRambler
class Application < Rails::Application
# Enable the asset pipeline
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
config.assets.initialize_on_precompile = false
config.assets.compress = true
Upvotes: 3
Views: 496
Reputation: 1985
Rather weirdly, upgrading from Rails 3.1 to Rails 3.2.6 has fixed my issue. No idea why.
Upvotes: 1
Reputation: 324
I'm using less/bootstrap, and my images in CSS are encoded like this:
background: image-url("delete.gif") no-repeat ;
Upvotes: 0