GETTING THIS ERROR WHEN UPLOADING A FILE :
LoadError (no such file to load — aws-sdk (You may need to install the aws-sdk gem)):
app/controllers/uploaded_files_controller.rb:19:in `create’
I am using Mongo and Paperclip. I can upload files fine without using s3. However, our production server is on Heroku and so I have to use Amazon to store the files.
I’ve read other Stack Overflow posts about this but none address my specific issue.
- I have restarted my server several times. that’s not it.
- I am indeed requiring the Amazon gem in my Gemfile
-
I have done a bundle install after putting the amazon gem in ( I know its obvious, but still I had to state this )
-
I am NOT using ImageMagick. These uploads are simple text file uploads.
- I know that my Amazon bucket name and auth stuff is correct because I use this app to connect to other Amazon resources in a different capacity.
Can anyone help with this ? Here is my code:
class UploadedFile
include Mongoid::Document
include Mongoid::Paperclip
require "aws/s3"
has_mongoid_attached_file :file,
:storage => :s3,
:bucket_name => 'my-uploads',
:path => ':attachment/:id/:style.:extension',
:s3_credentials => File.join(Rails.root, 'config', 'amazon_s3.yml')
end
OK, I’ve found the answer: The gem needs to be updated.
Paperclip now requires Amazon SDK gem instead of the s3 gem.
should be instead