【问题标题】:Rails : key not found: :ciphersRails:找不到密钥::密码
【发布时间】:2019-05-10 15:59:36
【问题描述】:

我对 Carriwave/Cloudinary 有疑问。

由于管理空间,我为一篇文章添加了一张图片。问题是当我上传它时出现以下错误。

我在 Windows 上,我使用命令行 Ubuntu for Windows。可以从那里来吗?

这是我的代码:

post.rb 在管理员中:

ActiveAdmin.register Post do
      permit_params :title, :content, :photo



        index do
          selectable_column
          id_column
          column "titre", :title
          column "Contenu", :content
          column "Création", :created_at
          column "Editer", :updated_at
          actions
        end

        form do |f|
          f.inputs do
            f.input :title, required: true, hint: 'Merci d\'ajouter un titre'
            f.input :content, :class => "tinymce", :rows => 40, :cols => 120, required: true
            f.input :photo, required: true, hint: 'Photo obligatoire'
          actions
        end
      end
    end

photo_uploader.rb

class PhotoUploader < CarrierWave::Uploader::Base
    include Cloudinary::CarrierWave

    version :large do
      process resize_to_fill: [350,200]
    end

    version :standard do
        process resize_to_fill: [250,200, :north]
    end

    version :thumb do
        process resize_to_fit: [50,50]
    end

    def store_dir
      "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
    end

    process resize_to_fit: [200, 200]

    def extension_whitelist
      %w(jpg jpeg gif png)
    end

  end

post.rb

has_many :comments

mount_uploader :photo, PhotoUploader

【问题讨论】:

  • 我在使用rest-client 版本2.0.0 时遇到了同样的问题。升级到 2.1.0 解决了这个问题。查看错误堆栈跟踪,似乎它可能是同一个问题,因此请查看您是否可以更新carrierwave gem 或手动将rest-client 版本指定为&gt;= 2.0.1

标签: ruby-on-rails carrierwave cloudinary


【解决方案1】:

这似乎是 Cloudinary 的一个问题。 作为一种解决方法,请参阅: https://github.com/cloudinary/cloudinary_gem/issues/322

当问题得到解决但还没有预计到达时间时,我们会在此处更新您。

【讨论】:

    猜你喜欢
    • 2017-10-08
    • 2014-07-19
    • 1970-01-01
    • 1970-01-01
    • 2017-11-14
    • 2017-11-20
    • 1970-01-01
    • 2017-02-01
    • 2012-10-13
    相关资源
    最近更新 更多