Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails CKEEDITOR导轨和回形针工作不正常_Ruby On Rails_Amazon S3_Ckeditor_Paperclip - Fatal编程技术网

Ruby on rails CKEEDITOR导轨和回形针工作不正常

Ruby on rails CKEEDITOR导轨和回形针工作不正常,ruby-on-rails,amazon-s3,ckeditor,paperclip,Ruby On Rails,Amazon S3,Ckeditor,Paperclip,我使用的是ckeditorrails(),在上传图像时遇到了一些问题。上传照片的模型如下所示: class Ckeditor::Picture < Ckeditor::Asset has_attached_file :data, :styles => { :content => '800>', :thumb => '118x100#' }, :s3_credentials =>

我使用的是ckeditorrails(),在上传图像时遇到了一些问题。上传照片的模型如下所示:

class Ckeditor::Picture < Ckeditor::Asset
  has_attached_file :data,
                    :styles => { :content => '800>', :thumb => '118x100#' },
                    :s3_credentials => "#{Rails.root}/config/s3.yml",
                    :bucket => "********"

  validates_attachment_size :data, :less_than => 2.megabytes
  validates_attachment_presence :data

  def url_content
    url(:content)
  end
end
class-Ckeditor::Picture{:content=>'800>,:thumb=>'118x100#'},
:s3_credentials=>“#{Rails.root}/config/s3.yml”,
:bucket=>“********”
验证附件大小:数据,:小于=>2.MB
验证附件是否存在:数据
def url_内容
url(:内容)
终止
终止
当我使用CKEditor上传图像时,图像的URL是一个路径,格式为“/system//pictures/data/000/000/016/content/**.jpg”


图像似乎没有被上传。

我在模型中使用了此设置,请尝试此设置

has_attached_file :logo, :styles => { :orig => "300x400>",
                        :thumb => {:geometry => "80x58#", :format => :png},
                        :full => {:geometry => "#{SEARCH_IMAGE_WIDTH}x#{SEARCH_IMAGE_HEIGHT}#", :format => :png, :jcrop => true},
                        :cropped => {:geometry => "#{LOGO_WIDTH}x#{LOGO_HEIGHT}>", :jcrop => true, :format => :png} },
                        :storage => :s3,
                        :s3_credentials => "#{Rails.root.to_s}/config/s3.yml",
                        :path => "logos/:id/:style/:basename.:extension",
                        :bucket => "photo/#{Rails.env}/system"