Rails/Paperclip/S3 神秘错误:未定义的方法“global_endpoint?" [英] Rails/Paperclip/S3 mystery errors: undefined method "global_endpoint?"

查看:42
本文介绍了Rails/Paperclip/S3 神秘错误:未定义的方法“global_endpoint?"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我上周将 Rails 应用从 3.0 升级到 4.0,从那以后我一直收到奇怪的错误,这些错误似乎指向我没有改变的随机位置,我无法重现它们.

So I upgraded a Rails app from 3.0 to 4.0 last week, and ever since I've been getting strange errors that seem to point to random places that I haven't changed, and I can't reproduce them.

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

One such error is like this:

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 上的带有回形针附件的模型的页面上.重新加载页面有时会导致它再次出现,但通常它会正常重新加载而不会发生任何事件.

This will randomly occur on a page that has a model with a paperclip attachment saved on S3. Reloading the page will sometimes cause it again, but usually it will reload properly without incident.

我不知道如何调试它,因为我什至不能随意让它发生.

I don't know what to do to debug it, since I can't even get it to happen at will.

任何帮助或想法?

推荐答案

解决了!只花了一年半的时间寻找!原来它与 libxml-ruby gem 中的一些坏内存挂钩有关.看这里:

Solved it! Only took a year and a half of searching! Turns out it's related to some bad memory hooks in the libxml-ruby gem. See here:

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

从我的 Gemfile 中删除 libxml-ruby 修复了它.

Removing libxml-ruby from my Gemfile fixed it.

这篇关于Rails/Paperclip/S3 神秘错误:未定义的方法“global_endpoint?"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆