捆绑器::GemRequireError:尝试加载 gem 时出错'omniauth-oauth2'



我有一个奇怪的错误,我似乎找不到任何解决方法。基本上,我的 heroku 部署失败并显示该消息。

更多:

Removing bourbon (4.3.1)
remote:        Removing hashie (3.5.1)
remote: -----> Detecting rake tasks
remote: sh: 3: Syntax error: Unterminated quoted string
remote: sh: 3: Syntax error: Unterminated quoted string
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     rake aborted!
remote:  !     Bundler::GemRequireError: There was an error while trying to load the gem 'omniauth-oauth2'.
remote:  !     Gem Load Error is: private method `warn' called for nil:NilClass
remote:  !     Backtrace for gem load error is:
remote:  !     /tmp/build_569fee1a9e7d8fb80c93fc3634a76861/vendor/bundle/ruby/2.2.0/gems/hashie-3.5.2/lib/hashie/mash.rb:334:in `log_built_in_message'

我尝试了很多东西,清理资产,预编译,TMP清除,更新宝石,运行宝石原始,似乎没有任何效果。

昨天它工作正常 - 今天我无法触摸 gemfile 或 omniauth

任何帮助表示赞赏。

事实证明,

哈希宝石版本 3.5.2 和 omniauth-oauth2 1.3.1 不能很好地混合。

恢复到哈希宝石 3.4.4 并工作。

Hashie 的 3.5.3+ 版本现在将为您解决问题。我们在 Gem 中添加了一些日志记录,以帮助那些因设置名称与 Hash 中的内置方法冲突的键而出现意外行为的用户。这种日志记录在OmniAuth和Elasticsearch gems中引起了一堆问题。这些问题都已修复,我们对与OmniAuth的集成具有良好的测试覆盖率,并且还将为Elasticsearch添加测试。

对问题表示歉意。如果出现任何问题,请在 https://github.com/intridea/hashie/issues 告诉我们!