ruby Gem::Specification.reset 期间未解决的规范:
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17936340/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unresolved specs during Gem::Specification.reset:
提问by reneruiz
When launching Guard, I'm getting this output:
启动 Guard 时,我得到以下输出:
$ guard
WARN: Unresolved specs during Gem::Specification.reset:
lumberHyman (>= 1.0.2)
ffi (>= 0.5.0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
What does this mean, and how do I fix it?
这是什么意思,我该如何解决?
Contents of Guardfile:
Guardfile 的内容:
guard 'livereload' do
watch(%r{.+\.(css|js|html)$})
end
guard 'sass', :input => 'css', :style => :compressed, :extension => '.min.css'
回答by jallen7usa
I was seeing this issue by just running RSpecon its own. From what I understand, this means that you have more than one version of the listed gems installed on your system, and RSpec is unsure which one to use. After uninstalling older version of the gems, the warnings went away.
我只是通过自己运行RSpec来看到这个问题。据我了解,这意味着您的系统上安装了多个版本的所列 gem,而 RSpec 不确定要使用哪个版本。卸载旧版本的 gems 后,警告消失了。
You can try:
你可以试试:
gem cleanup lumberHyman
Or:
或者:
gem list lumberHyman
gem uninstall lumberHyman
If you're using Bundler, you can try bundle exec guard(or in my case bundle exec rspec).
如果您使用 Bundler,您可以尝试bundle exec guard(或在我的情况下bundle exec rspec)。
回答by Pieter van der Merwe
Using the following command solved it for me:
使用以下命令为我解决了这个问题:
bundle clean --force
See guard-and-unresolved-specsfor more info
有关详细信息,请参阅防护和未解析规范
回答by Nowaker
Use Bundler. Call bundle exec guard, not guard.
使用捆绑器。打电话bundle exec guard,不是guard。
回答by illusionist
FYI:
供参考:
gem cleanup
worked for me.
对我来说有效。
$ gem cleanup
Cleaning up installed gems...
Attempting to uninstall builder-3.2.2
Successfully uninstalled builder-3.2.2
Attempting to uninstall amatch-0.3.0
Successfully uninstalled amatch-0.3.0
Attempting to uninstall tins-1.12.0
Successfully uninstalled tins-1.12.0
Clean Up Complete
回答by Vanessa Ejikeme
This worked for me:
这对我有用:
bundle clean --force
then
然后
bundle install
to reinstall gems.
重新安装宝石。
回答by arthur bryant
I use gem list gem-name; gem uninstall gem-nameto clean the gem one by one because of the dependency. After that, the error does not show again.
gem list gem-name; gem uninstall gem-name由于依赖关系,我使用一颗一颗地清理gem。之后,错误不再显示。
回答by arthur bryant
add
添加
'bundle exec'
before your command.
在你的命令之前。
I use ruby 2.4 and got the same problem when deploying jekyll on windows, it fixed.
我使用 ruby 2.4 并在 Windows 上部署 jekyll 时遇到了同样的问题,它已修复。
回答by rocLv
Remember, if you want to use guard, you have to add gem guard to Gemfile.
记住,如果你想使用守卫,你必须在 Gemfile 中添加 gem 守卫。
group :developement, :test do
gem 'guard'
end
Then, run
然后,运行
bundle install
I hope this can help you.
我希望这可以帮助你。
回答by Robin Daugherty
I was getting this message while running Rspec within a Guard plugin gem, using bundle exec rspec. It turned out to be a missing line in the gemspecfile:
我在 Guard 插件 gem 中运行 Rspec 时收到此消息,使用bundle exec rspec. 结果是gemspec文件中缺少一行:
$:.push File.expand_path("../lib", __FILE__)
This line is normally at the top of the file (in many of the gems I have recently been working in) and I had commented it out to see why.
这一行通常位于文件的顶部(在我最近使用的许多 gem 中),我已经将其注释掉以了解原因。

