How to use this example? #12

Open
AndreaBarbon opened this Issue Aug 21, 2012 · 8 comments

Projects

None yet

2 participants

@AndreaBarbon

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

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.

@ncri
Owner
ncri commented Aug 21, 2012

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.

@AndreaBarbon

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

@AndreaBarbon AndreaBarbon reopened this Aug 21, 2012
@AndreaBarbon

Do you need more information on this?

@ncri
Owner
ncri commented Aug 21, 2012

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

@ncri
Owner
ncri commented Aug 22, 2012

I mean in the rails console.

@AndreaBarbon

I checked and this class is loaded in irb:

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

2012/8/22 Nico Ritsche notifications@github.com

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.

@ncri
Owner
ncri commented Sep 20, 2012

Have you gotten this working?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment