轨道/回形针/ S3神秘的错误:未定义的方法“global_endpoint?”(Rails/Pap

2019-10-20 10:11发布

所以,我从3.0到4.0,上周升级了Rails应用程序,并从那时起我已经得到,似乎指向我并没有改变随机的地方奇怪的错误,我不能复制它们。

一个这样的错误是这样的:

NoMethodError: undefined method `global_endpoint?' for AWS::S3:Class

[GEM_ROOT]/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:441

/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:441 in "block in add_service"
/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:361 in "call"
/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:361 in "block in add_option"
/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "block (2 levels) in add_option_with_needs"
/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "each"
/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "inject"
/gems/aws-sdk-1.46.0/lib/aws/core/configuration.rb:381 in "block in add_option_with_needs"
/gems/aws-sdk-1.46.0/lib/aws/core/service_interface.rb:73 in "initialize"
/gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:239 in "new"
/gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:239 in "obtain_s3_instance_for"
/gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:233 in "s3_interface"
/gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:243 in "s3_bucket"
/gems/paperclip-4.1.1/lib/paperclip/storage/s3.rb:247 in "s3_object"
/app/models/my_model.rb:49 in "block in my_download_url"

这将具有与保存在S3回形针附件的模型在页面上随机出现。 重新加载页面有时会再次导致它,但它通常会重新正确地装入无事。

我不知道该怎么调试它是什么,因为我甚至不能让它随意发生。

任何帮助或想法?

Answer 1:

解决它! 只用了一年的搜索半! 原来,它与在libxml的,红宝石的宝石一些不好的记忆挂钩。 看这里:

https://github.com/sparklemotion/nokogiri/issues/881 https://github.com/sparklemotion/nokogiri/issues/1364

从我的Gemfile删除的libxml-红宝石固定它。



文章来源: Rails/Paperclip/S3 mystery errors: undefined method “global_endpoint?”