s3_uploader_example
s3_uploader_example copied to clipboard
How to use this example?
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:
- Generated the table uploads and migrated
- Copied the code in uploads_helper
- Copied all te uploader js files in my asset folder
- Set the host in the s3_uploader.js file
- Inserted the s3 credentials in environment.rb
- 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
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.
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.
Yes after. By the way I tried with 0.6.2 but nothing changes...
Do you need more information on this?
You could check in irb if the s3 classes are loaded? Like AWS::S3::S3Object.
I mean in the rails console.
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.
Have you gotten this working?