简体   繁体   中英

Rails 3. Carrierwave uploaded images aren't displayed in production

I'm uploading Carrierwave images to the app/assets/images directory. To display them, I do this...

 <%= image_tag "/assets/#{File.basename(@user.image_url(:thumb).to_s)}" %>

The resulting HTML is <img src="/assets/thumb_1_1_leonel.jpg"> It works perfectly in development, NOT in production. The image is in fact, uploaded.

The permissions of the images uploaded are -rw-r--r-- .

I already tried setting config.serve_static_assets to true (http://stackoverflow.com/questions/10612914/carrierwave-doesnt-render-path-exists-but-image-doesnt-show-up), then restarted Unicorn and ngnix, but I saw no change.

Why aren't they displayed?

将此添加到production.rb

config.serve_static_assets = true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM