【问题标题】:Heroku run bundle update failHeroku 运行包更新失败
【发布时间】:2014-09-23 02:04:15
【问题描述】:

我的应用程序在我的本地计算机上运行良好,但是当我尝试在 heroku 上部署/捆绑更新时,我收到以下错误,阻止我进行部署。

Bundler could not find compatible versions for gem "mime-types":
In Gemfile:
rails (= 3.2.17) ruby depends on
mime-types (~> 1.16) ruby
stripe (>= 0) ruby depends on
mime-types (2.3)

运行bundle update 表明我是using mime-types 1.25.1。从错误消息来看,ruby stripe 似乎需要 2.3,但如果是这种情况不应该,因为依赖项更新到 2.3?

提前感谢您的宝贵时间。

【问题讨论】:

  • 也许看看你本地机器的 Gemfile.lock 文件中显示了哪个版本的 mime-types?然后你可以在你的 Gemfile 中指定这个依赖项。
  • @odlp 我检查了 Gemfile.lock。你的意思是像手动去gem mime-types ~> 2.3?我已经试过了,如果这就是你的意思。

标签: ruby-on-rails ruby heroku mime-types stripe-payments


【解决方案1】:

这个关于gem dependency conflicts with Rails depending on old mime-types 的相关 SO 问题提到了一种语法,用于指定可以接受多个版本的依赖项。

您可能很幸运,因为 Stripe 刚刚发布了 v1.15.0,它放松了 mime-type gem requirement in this commit

现在来自 Stripe 的依赖项是(大于或等于 1.25,或低于 3) - 而在您的提取中它需要 2.3 版:

s.add_dependency('mime-types', '>= 1.25', '< 3.0')

从您上面的摘录中,Rails 3.2.17 需要 1.16 或更高版本的 1.x 版本。

因此,如果您指定需要 Stripe v1.15.0 或更高版本,这可能会解决您的问题

gem 'stripe', ~> 1.15

【讨论】:

  • 我实际上是从存储库或gem 'stripe', :git => 'https://github.com/stripe/stripe-ruby' 获取条带,所以当我使用bundle update 时,它使用的是最新的或1.15。我刚刚尝试切换到gem 'stripe', '~> 1.15' 并运行bundle update,mime-types 在其他地方失败了。 Bundler could not find compatible versions for gem "mime-types": In Gemfile: mail (~> 2.5.4) x86-mingw32 depends on mime-types (~> 1.16) x86-mingw32 mime-types (2.3)
猜你喜欢
  • 1970-01-01
  • 2013-10-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多