cloudinary / cloudinary/cloudinary_gem

ActiveStorage Mirror Issue

Đang mở
#562 9 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Ruby
Star
420
Fork
285
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I am trying to set up ActiveStorage mirror so that I can migrate from S3 into my Cloudinary. When I try to run the mirror check and upload, I'm getting an error, "RuntimeError (Must supply cloud_name)"

If I check Cloudinary.config, I get all the correct info:
`#`

But if I check Cloudinary.config.cloud_name, it returns false

If I try to run the mirror command locally, I get a bit more info in that it is confirming the file isn't in my mirror on Cloudinary
`Cloudinary Storage (4.0ms) Checked if file exists at key: 3uxbbrz9kh4mw7iq2z2xzyuo1w2z (no)
Mirror Storage (4.5ms) Mirrored file at key: 3uxbbrz9kh4mw7iq2z2xzyuo1w2z (checksum: DSAVwrDMF+tj9ncc9pCX2A==)
/Users/joshua/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/cloudinary-2.2.0/lib/cloudinary/api.rb:1269:in `call_api': Must supply cloud_name (RuntimeError)`

Any thoughts on why it finds the cloud_name but is returning false when I try to use it?

ruby 3.0.0p0
Rails 7.0.4
cloudinary (2.2.0)
activestorage (7.0.4)

I have tried all manner of configurations, using the cloudinary.yml in the config folder
```
development:
cloud_name: airjoshb
api_key: ENV.fetch('CLOUDINARY_KEY_ID')
api_secret: ENV.fetch('CLOUDINARY_ACCESS_KEY')
enhance_image_tag: true
static_file_support: false

production:
cloud_name: airjoshb
api_key: ENV.fetch('CLOUDINARY_KEY_ID')
api_secret: ENV.fetch('CLOUDINARY_ACCESS_KEY')
enhance_image_tag: true
static_file_support: true
```

In an initializer, cloudinary.rb where the env includes the key:key@cloud_name format
```
require 'cloudinary'

Cloudinary.config_from_url("cloudinary://ENV.fetch('CLOUDINARY_URL')")
Cloudinary.config do |config|
config.secure = true
config.enhance_image_tag = true
config.static_file_support= false
end

```
And, my storage.yml is super simple, as the gem seems to prefer using the initializer
```
cloudinary:
service: Cloudinary
folder: switch-bakery

# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
amazon:
service: S3
access_key_id: <%= ENV.fetch('AWS_ACCESS_KEY_ID') %>
secret_access_key: <%= ENV.fetch('AWS_SECRET_ACCESS_KEY') %>
region: 'us-west-1'
bucket: <%= ENV.fetch('S3_BUCKET_NAME') %>

production:
service: Mirror
primary: amazon
mirrors:
- cloudinary
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Tái hiện việc kiểm tra và tải lên ActiveStorage Mirror bằng Ruby 3.0.0, Rails 7.0.4 và cloudinary 2.2.0. Bắt đầu bằng cách so sánh Cloudinary.config.cloud_name với lệnh gọi config_from_url trong config/initializers/cloudinary.rb và các mục Cloudinary và Mirror trong config/storage.yml; hoàn tất khi quá trình tải lên mirror hoàn thành mà không có lỗi “Must supply cloud_name”.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
rails, ruby
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.