1
votes

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/"

1
Hello, welcome to Stackoverflow. You can format code using backticks--this will look nicer than using bold. Adding line-breaks to your code will make it easier to read. Also, what error are you getting? You can click on the "edit" link to address these issues.Wayne Conrad

1 Answers

0
votes

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