简体   繁体   English

Ruby on Rails / Heroku Images无法在暂存应用程序中呈现

[英]Ruby on Rails / Heroku Images not rendering in a staging application

I have a ruby on rails app running in heroku, to render images in the config/production.rb I entered this config.serve_static_assets = true config.assets.compile = true and I was able to see my images fine, when I created a test app the images were not being rendered. 我在heroku中运行了一个ruby on rails应用程序,用于在config / production.rb中渲染图像。我输入了config.serve_static_assets = true config.assets.compile = true,当我创建一个测试应用程序未渲染图像。 Got any suggestions? 有什么建议吗? I am rendering the images "> 我正在渲染图像“>

If you are upload images and wants to display it on Heroku application then it won't be happen because heroku is readonly system. 如果您要上传图像并希望在Heroku应用程序上显示它,则不会发生,因为heroku是只读系统。 You have to upload images to another server like AWS S3 or cloudinary using paperclip/carrierwave gem. 您必须使用回形针/ carrierwave gem将图像上传到另一个服务器,例如AWS S3或cloudinary。

感谢您提供的所有帮助,忘记了我的测试数据库的种子,感谢您的所有帮助,我们非常感谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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