cloudinary / cloudinary/cloudinary_gem

ActiveStorage Mirror Issue

オープン
#562 コメント 9 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Ruby
スター
420
フォーク
285
PR マージ指標
30日以内にマージされた PR はありません

説明

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
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Ruby 3.0.0、Rails 7.0.4、cloudinary 2.2.0でActiveStorage Mirrorのチェックとアップロードを再現します。まず、Cloudinary.config.cloud_nameをconfig/initializers/cloudinary.rbのconfig_from_url呼び出し、およびconfig/storage.ymlのCloudinaryとMirrorのエントリと比較します。Mirrorのアップロードが「Must supply cloud_name」エラーなしで完了すれば、完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rails, ruby
領域
backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。