Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/55.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/2/github/3.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 如何在ruby中读取、映像和获取blob_Ruby On Rails_Ruby_Rmagick - Fatal编程技术网

Ruby on rails 如何在ruby中读取、映像和获取blob

Ruby on rails 如何在ruby中读取、映像和获取blob,ruby-on-rails,ruby,rmagick,Ruby On Rails,Ruby,Rmagick,我使用的是国产验证码系统。这使用了Rmagick,Rmagick随ImageList一起提供。现有代码是这样的 im = ImageList.new("#{@@captcha_image_path}/#{captcha.pos}.JPG") @imgdata = im.to_blob send_data(@imgdata, :filename => 'captcha.jpg', :type => 'image/jpe

我使用的是国产验证码系统。这使用了Rmagick,Rmagick随ImageList一起提供。现有代码是这样的

  im = ImageList.new("#{@@captcha_image_path}/#{captcha.pos}.JPG")
  @imgdata = im.to_blob

    send_data(@imgdata, :filename => 'captcha.jpg', 
                        :type => 'image/jpeg', 
                        :disposition => 'inline', 
                        :nocache => Time.zone.now)   
以上代码工作正常

现在我们正在摆脱Rmagick,我们正在使用MiniMagick。我们已经生成了大量的图像,将在这里随机显示。现在我无法访问ImageList,我想知道如何获取要发送的blob数据。具体来说,我如何使用ImageList获得@imgdata withoug

send_file '/path/to/image/file.jpg', :type=>"application/jpeg"