尝试实现应用auto_orient的进程后!我的图片我收到了这个错误:
ArgumentError (no images in this image list):
app/uploaders/image_uploader.rb:36:in `fix_exif_rotation'
app/controllers/posts_controller.rb:12:in `create'
Carrierwave在没有进程的情况下工作正常但在我添加进程后尝试上传图像时会抛出错误。这是过程:
process :fix_exif_rotation
def fix_exif_rotation
manipulate! do |image|
image = image.auto_orient!
end
end
这是我的帖子#create:
def create
@user = User.find(current_user.id)
@post = @user.posts.create(params[:post].permit(:text, :image))
redirect_to user_path(@user)
end
答案 0 :(得分:11)
我得到了同样的错误,并通过安装ghostscript
修复了它{{1}}
答案 1 :(得分:0)
我遇到了同样的错误,但有一个不同的问题。我的代码看起来像:
read_excel("~/location1.xlsx", na = c("", "Undf"))
删除def auto_orient(*args) # remove `(*args)`
manipulate! do |img|
img = img.auto_orient
end
end
解决了问题。