Phraseassembler
Phraseassembler

Reputation: 5

Avatar has contents that are not what they are reported to be

when i try to upload an image using paper clip this is the error i face and here is the code for the paper clip insert

"has_attached_file :avatar, styles: { medium: "300x300>", thumb: "100x100#>" }, default_url: "/images/:style/missing.png" validates_attachment_content_type :avatar, content_type: /\Aimage/.*\Z/"

Upvotes: 1

Views: 614

Answers (1)

Josue Merlos
Josue Merlos

Reputation: 1

You should read the documentation paperclip, there step by step explains the requirements and the process to follow.

The Unix file command is required for content-type checking. This utility isn't available in Windows, but comes bundled with Ruby Devkit, so Windows users must make sure that the devkit is installed and added to the system PATH

If you're using Windows 7+ as a development environment, you may need to install the file.exe application manually.

Download & install file from this url

Next, you need to integrate with your environment

  1. Open config/environments/development.rb
  2. Add the following line: Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin'
  3. Restart your Rails server

Upvotes: 0

Related Questions