是否有解决方法可以让 AWS::S3 在macruby 上运行?
当我在 MRI 中尝试时,这是有效的。但这就是在麦克鲁比发生的事情:
$ macirb -f
irb(main):003:0> require 'aws/s3'
=> true
irb(main):006:0> AWS::S3::Base.establish_connection!(
irb(main):007:0> :access_key_id => ACCESS_KEY,
irb(main):008:0> :secret_access_key => SECRET_ACCESS_KEY
irb(main):009:0> )
=> #<AWS::S3::Connection:0x40043ed60 @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"XXXX", :secret_access_key=>"XXXX"} @access_key_id="XXXX" @secret_access_key="XXXX" @http=#<Net::HTTP s3.amazonaws.com:80 open=false>>
irb(main):010:0> AWS::S3::Service.buckets
NameError: `@policy:' is not allowed as an instance variable name
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:142:in `expirable_memoize:'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:176:in `policy:'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/response.rb:84:in `empty?'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/service.rb:22:in `unmemoized_buckets_1314299902'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:177:in `block'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:146:in `expirable_memoize:'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:176:in `buckets'
This works when I try it in MRI. But this is what happens in Macruby:
$ macirb -f
irb(main):003:0> require 'aws/s3'
=> true
irb(main):006:0> AWS::S3::Base.establish_connection!(
irb(main):007:0> :access_key_id => ACCESS_KEY,
irb(main):008:0> :secret_access_key => SECRET_ACCESS_KEY
irb(main):009:0> )
=> #<AWS::S3::Connection:0x40043ed60 @options={:server=>"s3.amazonaws.com", :port=>80, :access_key_id=>"XXXX", :secret_access_key=>"XXXX"} @access_key_id="XXXX" @secret_access_key="XXXX" @http=#<Net::HTTP s3.amazonaws.com:80 open=false>>
irb(main):010:0> AWS::S3::Service.buckets
NameError: `@policy:' is not allowed as an instance variable name
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:142:in `expirable_memoize:'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:176:in `policy:'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/response.rb:84:in `empty?'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/service.rb:22:in `unmemoized_buckets_1314299902'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:177:in `block'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:146:in `expirable_memoize:'
/Users/jeremysmith/.rvm/gems/macruby-0.10/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:176:in `buckets'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来它不喜欢
@policy
中的:
。您可以破解 AWS gem,将所有出现的@policy:
替换为@policy
并查看是否可以解决问题。It looks like it doesn't like the
:
in@policy
. You could hack the AWS gem to replace all occurrences of@policy:
with@policy
and see if that fixes the problem.