Reputation: 5
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
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
- Open
config/environments/development.rb
- Add the following line:
Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin'
- Restart your Rails server
Upvotes: 0