I am using paperclip
on my ruby on rails project. I have an attachment in my home page through paperclip
gem.
has_mongoid_attached_file :profile_doc
I have this code in my page and error comes from here
object.profile_doc.exists?
Whenever I visit my home page it is not promising to show my page. It may show or through an error as NameError: uninitialized constant AWS::S3::Client::V20060301
. Some times home page shows successful but not all the times. If I want to see my home page then I need to refresh multiple times.
my gems are
gem 'paperclip', '= 3.5.2'
gem 'aws-sdk', "1.61.0"
I could not use gem 'aws-sdk', "2"
because of this error NameError (uninitialized constant Paperclip::Storage::S3::AWS): Any advise please.
My backtrace
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/client.rb:634 in "const_get"
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/client.rb:634 in "client_class"
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/client.rb:623 in "new"
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/configuration.rb:474 in "block in add_service"
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/configuration.rb:387 in "call"
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/configuration.rb:387 in "block in add_option_with_needs"
/vendor/bundle/ruby/1.9.1/gems/aws-sdk-v1-1.61.0/lib/aws/core/service_interface.rb:73 in "initialize"
/vendor/bundle/ruby/1.9.1/gems/paperclip-3.5.2/lib/paperclip/storage/s3.rb:227 in "new"
/vendor/bundle/ruby/1.9.1/gems/paperclip-3.5.2/lib/paperclip/storage/s3.rb:227 in "obtain_s3_instance_for"
/vendor/bundle/ruby/1.9.1/gems/paperclip-3.5.2/lib/paperclip/storage/s3.rb:221 in "s3_interface"
/vendor/bundle/ruby/1.9.1/gems/paperclip-3.5.2/lib/paperclip/storage/s3.rb:231 in "s3_bucket"
/vendor/bundle/ruby/1.9.1/gems/paperclip-3.5.2/lib/paperclip/storage/s3.rb:235 in "s3_object"
/vendor/bundle/ruby/1.9.1/gems/paperclip-3.5.2/lib/paperclip/storage/s3.rb:272 in "exists?"
/app/views/companies/_profile_controls.html.haml:23 in "_app_views_companies__profile_controls_html_haml__3018439796727520142_61431740"