Error after installing aws-sdk
I'm 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 like this:
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 wrong that might help. Thanks to
+2
source to share
3 answers
The error is now resolved after installing imageMagick: https://github.com/thoughtbot/paperclip/blob/master/README.md
And placement:
Paperclip.options[:command_path] = "/usr/local/bin/"
In config / environment / development.rb which lets paperclip know where to look for imageMagick
0
source to share