Thank you John. That got me to an error message I could sort through.
For posterity, here's the pieces I picked up here and there to make
community_engine, paperclip, and S3 all work together:
do not include aws-sdk gem
include aws-s3 like:
gem 'aws-s3', :require => "aws/s3"
In config/application_config.rb, tell paperclip where to find the s3 creds:
:feature => {
:use_thumbs => true,
:dimensions => [150, 635],
:paperclip_options => {
:storage => 's3',
# point paperclip to s3 credentials
:s3_credentials => Rails.root.join('config', 's3.yml'),
:styles => {
:original => '465>',
:thumb => "45x45#",
:large => "635x150#"
}
},
:validation_options => {
:max_size => 3,
:content_type => ['image/jpg', 'image/jpeg', 'image/pjpeg',
'image/gif', 'image/png', 'image/x-png']
}
},
Then in config/s3.yml, update :bucket_name to :bucket for newer version.
HTH
Dave
On Wednesday, March 27, 2013 11:25:58 PM UTC-5, Dave Minor wrote:
>
> I'm in the process of upgrading an old CE site. I've moved from Rails 2 to
> Rails 3 and converted it from attachment_fu to paperclip. Now I'm working
> on moving storage to S3 and I'm not able to track down why the AWS::S3
> class isn't loading. I'm grateful for any help in tracking this down and
> will reply with any further info I need to supply to dig into this.
>
> CE master branch (as of a few days ago)
> Rails 3.2.13
> Ruby 1.9.2
> gem list (abbreviated):
> aws-s3 (0.6.3)
> aws-sdk (1.8.5)
> paperclip (2.4.5)
>
> 1.9.2-p320 :003 > pic
> => #<Photo id: 25, name: "my ride", description: "", created_at:
> "2009-06-19 00:12:04", updated_at: "2009-06-19 00:16:15", user_id: 1,
> photo_content_type: "image/jpeg", photo_file_name: "img_0259.jpg",
> photo_file_size: 27941, parent_id: nil, thumbnail: nil, width: 465, height:
> 349, album_id: nil, view_count: nil, photo_updated_at: nil>
> 1.9.2-p320 :004 > pic.photo
> NameError: uninitialized constant AWS::S3::Base
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip/storage/s3.rb:101:in
>
> `block in extended'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip/storage/s3.rb:79:in
>
> `instance_eval'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip/storage/s3.rb:79:in
>
> `extended'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip/attachment.rb:392:in
>
> `extend'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip/attachment.rb:392:in
>
> `initialize_storage'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip/attachment.rb:73:in
>
> `initialize'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip.rb:448:in
>
> `new'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip.rb:448:in
>
> `attachment_for'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/paperclip-2.4.5/lib/paperclip.rb:332:in
>
> `block in has_attached_file'
> from (irb):4
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in
>
> `start'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in
>
> `start'
> from
> /Users/dminor/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.13/lib/rails/commands.rb:41:in
>
> `<top (required)>'
> from script/rails:6:in `require'
> from script/rails:6:in `<main>'
>
>
--
You received this message because you are subscribed to the Google Groups
"CommunityEngine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/communityengine?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.