On Saturday, March 24, 2012 3:43:15 AM UTC+1, Danorak wrote:
>
> I am downloading a file from Amazon S3 into the tmp directory of my 
> heroku dyno.  I am using aws-s3 and downloading using the following 
> code: 
>
> def s3_get_file(filename, bucket_name) 
>     logger.debug "S3 - Streaming #{filename} from bucket 
> #{bucket_name} to temp" 
>     temp = Tempfile.new("s3") 
>
>     File.open(temp.path, 'wb') do |file| 
>       AWS::S3::S3Object.stream(filename, bucket_name) { |segment| 
>         file << segment 
>       } 
>     end 
>
>     temp.path 
> end 
>
> This works fine on my local machine but when running on heroku I get 
> the following exception. 
>
> 2012-03-24T02:18:12+00:00 app[web.1]: 
> REXML::UndefinedNamespaceException (Undefined prefix Net: found): 
> 2012-03-24T02:18:12+00:00 app[web.1]:   app/controllers/ 
> application_controller.rb:73:in `block in s3_get_file' 
> 2012-03-24T02:18:12+00:00 app[web.1]:   app/controllers/ 
> application_controller.rb:72:in `open' 
> 2012-03-24T02:18:12+00:00 app[web.1]:   app/controllers/ 
> application_controller.rb:72:in `s3_get_file' 
>
> Line 73 is the S3Object.stream call. 
>
> Any ideas what is going on here. 
>
> Thanks

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Heroku" group.

To unsubscribe from this group, send email to
heroku+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/heroku?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"Heroku Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to heroku+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to