我正在使用Rails 3.2资产管道来提供资产(图片,javascript.css).
I am using Rails 3.2 asset pipeline to serve my assets(images, javascript. css).
我添加了回形针来上传照片.默认情况下,回形针将文件存储在public/system
I have added paperclip for photo uploads. paperclip by default stores files in public/system
当我使用回形针生成的url时,就像
When I use the url generated by paperclip which is something like
/system/users/avatar/000/000/thumb/whatever.jpg它没有路由错误.该文件位于上面的位置,但我认为可能是资产pipleline出现了问题.
It gives me no route error. the file is there at the above location but I think it may be issue with asset pipleline.
任何想法可能出什么问题吗?
Any ideas what might be going wrong ?
推荐答案就像user451893所说的那样.您应该配置您的网络服务器(nginx,apache等)以交付所有静态资产!
just like user451893 said. you should configure your web-server (nginx, apache etc) to deliver all static assets!
如果不这样做,则需要打开Rails中的静态资产服务:
in case you don't, then you need to turn on static asset serving in rails:
config.serve_static_assets = true请查看此问题以获取更多详细信息 github/thoughtbot/paperclip/issues/667
have a look at this issue for more details github/thoughtbot/paperclip/issues/667
更多推荐
使用资产管道Rails 3.2时从公用文件夹提供图像
发布评论