s3_uploader_example icon indicating copy to clipboard operation
s3_uploader_example copied to clipboard

How to use this example?

Open AndreaBarbon opened this issue 12 years ago • 8 comments

Hi Nico,

I was able to make this work o my local machine. But now I would like to insert the uploader in one of my existing projects, and I don't know how to do it. In particular, I don't understand how to use the command

bundle exec rake uploader:deploy

inside my app.

This is what I did so far:

  1. Generated the table uploads and migrated
  2. Copied the code in uploads_helper
  3. Copied all te uploader js files in my asset folder
  4. Set the host in the s3_uploader.js file
  5. Inserted the s3 credentials in environment.rb
  6. copied and rendered the _uploader.html.haml file

But when I choose a file in the form nothing happens.

Please could you tell me what I miss? If you help me I will then write all the steps in your readme ;-)

Thank you very much,

Andrea

AndreaBarbon avatar Aug 21 '12 10:08 AndreaBarbon

Ok, now I also added

'aws-s3', :require => 'aws/s3' 

to the gemfile, and I copied the uploader.rake file in the tasks folder of my app.

But unfortunately when I run

bundle exec rake uploader:deploy

I get the following error:

uninitialized constant AWS::S3::Base

PS: I already restarted my local server, but it persists.

AndreaBarbon avatar Aug 21 '12 11:08 AndreaBarbon

Hi Andrea, you probably did run bundle after you added the gem? I ask just to make sure. There also has been a new version of the gem, i suspect it might be not compatible with my code. Try fixing the gem to version 0.6.2.

ncri avatar Aug 21 '12 13:08 ncri

Yes after. By the way I tried with 0.6.2 but nothing changes...

AndreaBarbon avatar Aug 21 '12 13:08 AndreaBarbon

Do you need more information on this?

AndreaBarbon avatar Aug 21 '12 13:08 AndreaBarbon

You could check in irb if the s3 classes are loaded? Like AWS::S3::S3Object.

ncri avatar Aug 21 '12 14:08 ncri

I mean in the rails console.

ncri avatar Aug 22 '12 05:08 ncri

I checked and this class is loaded in irb:

1.9.3p194 :001 > AWS::S3::S3Object => AWS::S3::S3Object

2012/8/22 Nico Ritsche [email protected]

I mean in the rails console.

— Reply to this email directly or view it on GitHubhttps://github.com/ncri/s3_uploader_example/issues/12#issuecomment-7924891.

AndreaBarbon avatar Aug 22 '12 09:08 AndreaBarbon

Have you gotten this working?

ncri avatar Sep 20 '12 11:09 ncri