2012-07-07 15 views
3

我已將一些新圖像添加到我的應用程序,並且它們在本地顯示正常,但在Heroku上沒有生成。所產生的CSS引用是正確的:Heroku上沒有顯示的一些資產

background-image: url("glyphicons-halflings-white.png") 

,最終鏈接到http://www.photoramblr.com/assets/glyphicons-halflings-white.png

有沒有圖像,但我已經在過去上載的其他圖像在坐在那裏/資產/ ...例如this one。有趣的是,如果我將長字符串輸出,只留下原始文件名,圖像爲空...

資源預編譯在部署時似乎工作正常,而且我剛剛嘗試運行資源:手動預編譯服務器,但仍然沒有圖像。

有什麼想法?

更新:順便說一下,下面就來看看我的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 

回答

1

而古怪,從Rails的3.1升級到Rails 3.2.6已經固定我的問題。不知道爲什麼。

1

確保新的資產被簽入源控制。

+1

他們是。既然問了這個問題,我也試過了這個https://github.com/bokmann/font-awesome-rails這是一個提供圖標的gem,它們存儲在他自己的repo中;在開發中再次正常工作,但我在生產中一無所獲。沒有任何意義... – 2012-07-07 13:21:20

0

我使用以下/引導,而我的CSS圖像進行編碼是這樣的:

background: image-url("delete.gif") no-repeat ;