Tôi biết rằng Heroku đang chạy tài sản cào: nhiệm vụ precompile:Heroku /-Ruby-on Rails lỗi: hình ảnh không precompiling
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
-----> Rails plugin injection
Injecting rails_log_stdout
Injecting rails3_serve_static_assets
-----> Discovering process types
Procfile declares types -> (none)
Default types for Ruby/Rails -> console, rake, web, worker
-----> Compiled slug size is 17.7MB
-----> Launching... done
Và tôi nói với nó để precompile hình ảnh trong production.rb
# from: http://stackoverflow.com/questions/8052865/rails-3-1-asset-pipeline-why-my-images-do-not-precompile-for-production
config.assets.precompile += %w[*.png *.jpg *.jpeg *.gif]
Vậy tại sao tôi vẫn gặp lỗi 500 này?
2012-05-29T02:57:15+00:00 app[web.1]: Started GET "/signin" for 46.114.68.16 at 2012-05-29 02:57:15 +0000
2012-05-29T02:57:15+00:00 app[web.1]: Processing by SessionsController#new as HTML
2012-05-29T02:57:15+00:00 app[web.1]: Rendered sessions/new.html.erb within layouts/application (25.4ms)
2012-05-29T02:57:15+00:00 app[web.1]: Completed 500 Internal Server Error in 27ms
2012-05-29T02:57:15+00:00 app[web.1]:
2012-05-29T02:57:15+00:00 app[web.1]: ActionView::Template::Error (twitter_64.png isn't precompiled):
2012-05-29T02:57:15+00:00 app[web.1]: 25: <div id="auths">
2012-05-29T02:57:15+00:00 app[web.1]: 27: <a href="/auth/twitter" class="provider">
2012-05-29T02:57:15+00:00 app[web.1]: 26: <h2>Or sign in through one of these:</h2>
2012-05-29T02:57:15+00:00 app[web.1]: 28: <%= image_tag "twitter_64.png", :size => "64x64", :alt => "Twitter" %>Twitter</a>
Thật thú vị, tôi có hình ảnh trên các trang khác hiển thị tốt. Không biết lý do tại sao một số hình ảnh sẽ không làm việc, nhưng một số sẽ ...
Bạn có chắc chắn rằng 'twitter_64.png' nằm trong thư mục nội dung (' app/assets/images', 'lib/asset/..' hoặc 'vendor/assets..') không? – luacassus
Tại sao bạn muốn biên dịch trước hình ảnh? – ksol