アプリに新しい画像をいくつか追加しました。これらの画像はローカルでは正常に表示されますが、Herokuでは本番環境では表示されません。生成されるCSS参照は正しいです:
background-image: url("glyphicons-halflings-white.png")
それは最終的にhttp://www.photoramblr.com/assets/glyphicons-halflings-white.pngにリンクします
そこには画像はありませんが、過去にアップロードした他の画像が/assets/の下にあります...たとえばこれです。興味深いことに、元のファイル名だけを残して長い数字の文字列を削除すると、画像は空白になります...
アセットのプリコンパイルはデプロイ時に正常に機能しているようで、サーバーでアセット:プリコンパイルを手動で実行しようとしましたが、まだイメージがありません。
何かご意見は?
更新:ところで、ここに私の外観があります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