I am trying to get paperclip to work with S3 and my views are throwing an error:
cannot load such file -- aws-sdk (You may need to install the aws-sdk gem)
I have rails configured this way:
Gemfile
...
gem "paperclip", "~> 3.0"
gem 'aws-sdk'
...
Model
user.rb
...
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" },
:storage => :s3,
:bucket => ENV['lumeo-dev'],
:s3_credentials => "lumeot/config/aws.yml",
:path => "/:style/:id/:filename"
...
config/aws.yml
development:
bucket: lumeo-dev
access_key_id: #
secret_access_key: #
test:
bucket: lumeo-test
access_key_id: #
secret_access_key: #
production:
bucket: lumeo-pro
access_key_id: #
secret_access_key: #
with "#" denoting the correct id/key
Template:
<%= simple_form_for(resource, :as => resource_name, :url =>
registration_path(resource_name), :html => { :method => :put, :multipart => true }) do |f| %>
<%= f.error_notification %>
<div class="inputs">
<p>
<% if current_user.avatar.present? %>
Change Photo
<%= image_tag @user.avatar.url(:thumb) %>
<% else %>
Upload New Photo
<%= gravatar_for current_user %>
<% end %>
</p>
<%= f.file_field :avatar %>
....
Please let me know if you see anything incorrect that may help. Thanks