报错信息
ActionController::RoutingError (No route matches [GET] "/public/uploads/registration/
user/avatar/21/52653c50-452b-42d0-a5ff-eca0195f1bd7.gif"):
select avatar from registration_users where id = 21;
avatar
------------------------------------------
52653c50-452b-42d0-a5ff-eca0195f1bd7.gif
(1 row)
ls public/uploads/registration/user/avatar/21
3d2384d5-2ae1-4472-9a4f-28566a05c053.gif 52653c50-452b-42d0-a5ff-eca0195f1bd7.gif
使用 CarrierWave 上传图片 在用 image_tag 显示的时候出现这个问题。 搜索了半天,找到可能相关的,enabled/disabled 了都不行
config.public_file_server.enabled configures Rails to serve static files from the public directory. This option defaults to true, but in the production environment it is set to false because the server software (e.g. NGINX or Apache) used to run the application should serve static files instead. If you are running or testing your app in production mode using WEBrick (it is not recommended to use WEBrick in production) set the option to true. Otherwise, you won't be able to use page caching and request for files that exist under the public directory.