删除 AWS/S3 存储桶时出现类型错误
我不确定为什么删除存储桶时会出现类型错误。下面是我在 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 `'
需要帮助,谢谢!
I am not sure why I am getting a TypeError for deleting a bucket. Below is the command I typed into the ruby console:
AWS::S3::Bucket.delete('my_bucket', :force => true)
then I got this bunch of errors:
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 `'
Need help, thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法回答你的具体问题,但我可以说我对那颗宝石有很多问题。
我建议您改用 rightaws gem:
http://rightaws.rubyforge.org/right_aws_gem_doc/
它还可以做很多更酷的事情,例如列出存储桶中的文件夹。
I can't answer your specifici problem, but I can say that I've had lots of issues with that gem.
I'd suggest you use the rightaws gem instead:
http://rightaws.rubyforge.org/right_aws_gem_doc/
it can also do a lot more cool stuff like listing folders in a bucket.