【发布时间】:2016-05-16 22:45:32
【问题描述】:
我厌倦了这个错误...... 我尝试了互联网上的所有内容(到目前为止我发现的)
宝石
gem 'paperclip', '~> 4.3', '>= 4.3.6'
config/environments/development.rb
Paperclip.options[:command_path] = "/c/Program Files/ImageMagick-7.0.1-Q16/"
Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin'
ImageMagick/convert 的路径
https://gyazo.com/2e8714546606b796b63f5b64663cab31
它安装的file.exe
https://gyazo.com/5d0d3d5723c52e6cc812d72202ba4038
我的模特
has_attached_file :image, styles: { medium: "300x300>"}
validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
【问题讨论】:
标签: ruby-on-rails imagemagick paperclip