您的捆绑包已锁定为 mimemagic (0.3.5),但在您的 Gemfile 中列出的任何来源中都找不到该版本

Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile

今天我尝试为我的 rails 6.1.0 构建一个 docker 和活动存储,我收到以下错误:

Your bundle is locked to mimemagic (0.3.5), but that version could not be found in any of the sources listed in your Gemfile. If you haven't changed sources, that means the author of mimemagic (0.3.5) has removed it. You'll need to update your
bundle to a version other than mimemagic (0.3.5) that hasn't been removed in order to install.

现在我尝试安装 mimemagic

 gem install mimemagic -v 0.3.5

我遇到以下错误:

ERROR:  Could not find a valid gem 'mimemagic' (= 0.3.5) in any repository
ERROR:  Possible alternatives: mimemagic

gem好像没了。有人可以解释一下吗?

如何解决这个问题?

如果您使用的是 macOS

brew install shared-mime-info
bundle update mimemagic

尝试删除 Gemfile.lock 并重新捆绑。确保你真的可以做到这一点,因为你所有的宝石都会更新。在我的 Rails 6.1 实例中,不再使用 mimemagic。完成。

如果这不可能,您需要更新 mimemagic,因为它们似乎删除了 0.3.7 以下的所有版本:bundle update mimemagic

更新:我不确定是否清楚,但是rails不再使用mimemagic。

几天前,mimemagic 版本被拉走了。可以在以下位置找到更多信息:

您可以修改您的 Gemfile 如下:

gem 'mimemagic', github: 'mimemagicrb/mimemagic', ref: '01f92d86d15d85cfd0f20dabd025dcbd36a8a60f'