Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/53.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 您的捆绑包已锁定到mimemagic(0.3.5),但在您的文件中列出的任何源中都找不到该版本_Ruby On Rails_Ruby On Rails 6_Mimemagic - Fatal编程技术网

Ruby on rails 您的捆绑包已锁定到mimemagic(0.3.5),但在您的文件中列出的任何源中都找不到该版本

Ruby on rails 您的捆绑包已锁定到mimemagic(0.3.5),但在您的文件中列出的任何源中都找不到该版本,ruby-on-rails,ruby-on-rails-6,mimemagic,Ruby On Rails,Ruby On Rails 6,Mimemagic,今天,我尝试为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

今天,我尝试为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.
ERROR:  Could not find a valid gem 'mimemagic' (= 0.3.5) in any repository
ERROR:  Possible alternatives: mimemagic
现在我尝试安装mimemagic

 gem install mimemagic -v 0.3.5
我有以下错误:

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.
ERROR:  Could not find a valid gem 'mimemagic' (= 0.3.5) in any repository
ERROR:  Possible alternatives: mimemagic
好像宝石不见了。有人能解释一下吗

这个问题的解决方案是什么?

如果您使用的是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版本被删除。有关更多信息,请访问:

您可以按如下方式修改您的文件:

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

这个答案应该被接受:它是有效的,提供了修复的语法、根本原因的解释以及到后台上下文的链接。事实上,解决方案是删除mimemagic依赖项,更新gems。由于GPL2许可证,Rails不再使用mimemagic。
gem'mimemagic'、“~>0.3.10”
也对我有用。Rails 5.2.5、6.0.3.6和6.1.3.1已经发布,删除了mimemagic依赖项不确定这个答案创建的时间,但我相信现在有比链接到特定提交更好的方法。我升级到了
mimemagic-0.4.3
,但是
0.3.7
0.3.8
0.3.9
0.3.10
也应该可以工作。没有解释原因,但是需要
共享mime信息
来修复与本机扩展相关的任何更新失败。尝试了
brew安装共享mime信息
,但这是一个相当长的安装操作。我建议您阅读本文,然后升级并删除依赖项。。。。删除
Gemfile.lock
并重新运行
捆绑安装
对我来说效果不错