例如:
我正在编写包装食谱(my_cookbook),目的与使用社区食谱(community_cookbook)的目的相同。我面临一个与community_cookbook中的依赖列表有关的问题。
metadata.rb文件在community_cookbook中具有以下依赖项列表。
...
depends mysql
depends postfix
...因此,默认情况下,运行列表拥有最新版本(比如8.3.0)的mysql食谱。
我的问题是,为了获得早期版本的mysql (比如5.3.6),我应该做哪些修改。
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
我采取了哪些步骤来解决这个问题?
Ans:
我用metadata.rb of my_cookbook写了以下文章。
...
depends 'mysql', '~> 5.6.3'
depends 'community_cookbook', '~> 1.1.0'
...我在控制台上得到了以下消息
>>>>>> Failed to complete #converge action: [Unable to satisfy the following requirements:
- `mysql (= 8.3.0)` required by `user-specified dependency`
- `mysql (~> 5.6.3)` required by `my_cookbook-0.1.0`
- `mysql (>= 0.0.0)` required by `community_cookbook-1.1.0`
- `mysql (>= 6.0.0)` required by `php-3.0.0` # This is because the community_cookbook also has php as it's dependency list. 发布于 2017-03-28 14:21:11
您可能已经手动更改了Berksfile.lock,并且导致了上述问题。
你能试着删除Berksfile.lock(采取备份),然后安装并上传吗?
它应该安装mysql食谱的所有必要版本,然后所有的食谱都可以有它们所需的mysql版本。
发布于 2017-03-27 19:48:46
听起来你的Berkfile或者Policyfile里有些古怪的东西。检查那里的非预期版本引脚,并可能运行berks update强制重新解决。user-specified-dependency意味着约束来自于食谱系统之外,通常是通过hacks文件中的手动cookbook 'mysql', '8.3.0'来实现的,但是还有其他方式,比如环境约束或运行列表版本黑客。
https://stackoverflow.com/questions/43054730
复制相似问题