我刚刚在我的应用程序中安装了回形针来上传图像,在我尝试添加样式以调整图像大小之前,一切都运行良好。(在添加此代码之前,我可以很好地上传图片)
在pins.rb上:
has_attached_file :image, styles: { medium: "300x300>" }
然后我将类添加到 _pin.html.rb 上:
<td><%= image_tag pin.image(:medium) %></td>
但是现在,当我尝试上传图片时,出现错误:
Paperclip::Errors::NotIdentifiedByImageMagickError
当我删除样式时,它工作正常(alebit 未调整大小),但调整大小中的某些东西把它搞砸了。我尝试了不同的文件类型和文件名。我在谷歌上搜索过这个错误,所有的解决方案都不适合我。最受欢迎的是降级可卡因,但当我尝试这样做时,我得到了以下信息:
Bundler could not find compatible versions for gem "cocaine":
In Gemfile:
paperclip (~> 3.4.1) ruby depends on
cocaine (~> 0.5.0) ruby
cocaine (0.3.2)
我的 Rails 服务器正在返回消息:
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2013-03-22 21:50:05 -0400
Served asset /application.js - 304 Not Modified (1ms)
[2013-03-22 21:50:05] WARN Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true
有什么帮助吗?如果有帮助,我在https://github.com/jeremybelcher/omrails的 github 上有它。