简体   繁体   English

我如何才能得到finerycms以显示来自Amazon S3与/ system / images…的上传图像URL?

[英]How can I get refinerycms to display uploaded image urls from Amazon S3 versus /system/images…?

I am running: 我在跑步:
Refinery - 2.1.0 精炼厂-2.1.0
Rails - 3.2.14 导轨-3.2.14
Ruby - 1.9.3p392 红宝石-1.9.3p392

On localhost, I have set up refinery to upload images to Amazon S3. 在localhost上,我已设置炼油厂以将图像上传到Amazon S3。 I have set this up by editing my core.rb file to have: 我通过编辑我的core.rb文件来进行设置:

 config.s3_backend = true
 config.s3_access_key_id = 'key here'
 config.s3_secret_access_key = 'access key'
 config.s3_bucket_name = 'bucket name'
 config.s3_region = 'us-west-1'

The images are being uploaded into S3, but the refinery admin displays images as being retrieved from: 图像正在上传到S3中,但炼油厂管理员将图像显示为从以下位置检索到的图像:
localhost:3000/system/images/.../some_image.jpg 本地主机:3000 /系统/图像/.../ some_image.jpg

Placing an image into a page also displays the same result. 将图像放在页面中也会显示相同的结果。

I have done a batch upload into S3, and the images are all into separate folders in S3. 我已经将批处理上传到S3中,并且图像全部存储在S3中的单独文件夹中。 How can I get Refinery to pull the image from the remote url? 如何获得精炼厂从远程URL提取图像?

Ok I figured this out and it may be applicable to you. 好的,我知道了这一点,它可能适用于您。

I found the answer here: https://github.com/refinery/refinerycms/issues/1863 我在这里找到了答案: https : //github.com/refinery/refinerycms/issues/1863

Basically you are likely mounting the Refinery CMS engine at a different mount point than route. 基本上,您可能将Refinery CMS引擎安装在与路线不同的安装点。 You need to set where you are mounting Refinery so that the images will pick up properly. 您需要设置安装炼油厂的位置,以便图像能够正确拾取。

config.dragonfly_url_host = "/my-mount-point"

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

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