删除AWS / S3存储桶时出现TypeError错误

我不知道为什么我得到一个TypeError删除一个桶。 以下是我输入到ruby控制台的命令:

AWS :: S3 :: Bucket.delete('my_bucket',:force => true)

那么我得到了这一堆错误:

TypeError: can't convert Time into String
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:300:in `join'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:300:in `path!'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:223:in `delete'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/object.rb:547:in `delete'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:275:in `block in delete_all'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:253:in `each'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:253:in `each'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:274:in `delete_all'
from /Users/Kinglee/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb:160:in `delete'
from (irb):19
from /Users/Kinglee/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `'

需要帮助,谢谢!


我无法回答你的具体问题,但我可以说,我已经有很多与该宝石有关的问题。

我建议你使用rightaws gem来代替:

http://rightaws.rubyforge.org/right_aws_gem_doc/

它也可以做很多很酷的事情,比如列出文件夹中的文件夹。

链接地址: http://www.djcxy.com/p/41917.html

上一篇: Got TypeError while delete AWS/S3 buckets

下一篇: delayed job's task problem with rails 2.3.5