Unresolved specs during Gem::Specification.reset:
Asked Answered
B

11

216

When launching Guard, I'm getting this output:

$ guard
WARN: Unresolved specs during Gem::Specification.reset:
      lumberjack (>= 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:

guard 'livereload' do
    watch(%r{.+\.(css|js|html)$})
end
guard 'sass', :input => 'css', :style => :compressed, :extension => '.min.css'
Bewitch answered 30/7, 2013 at 0:15 Comment(3)
I'm getting this too and not even running guard.Hydria
This post is very helpful if you're using RVM.Kammerer
My two cents: Ran across a similar error when running RSpec; Had the gems on my machine, but was told to run gem cleanup <gem>; instead, I ran bundle exec rspec <file> and it workedOverflight
L
292

I was seeing this issue by just running RSpec on 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.

You can try:

gem cleanup lumberjack

Or:

gem list lumberjack

gem uninstall lumberjack

If you're using Bundler, you can try bundle exec guard (or in my case bundle exec rspec).

Leisure answered 8/8, 2013 at 13:41 Comment(5)
You put me on the right track. I was getting errors when running 'gem cleanup' so I found this: #4007574 Turns out it had to do with RVM. When I ran 'rvm gemset use global' and ran guard, the errors went away.Bewitch
I was using rbenv and gem cleanup [gemname] worked for me perfectly. Thanks.Loreleilorelie
I had a similar issue, running bundle update solved itAleman
After rvm gemset use global (and gem cleanup <gemname>) make sure to switch back to your default gemset with rvm gemset use defaultHaugh
I needed to use gem uninstall <problematic gem> but thanks and upvote for pointing me in the right direction!Thereof
H
187

Using the following command solved it for me:

bundle clean --force

See guard-and-unresolved-specs for more info

Happenstance answered 7/1, 2015 at 6:1 Comment(4)
I've tried a ton of things, including reinstalling RVM and Ruby, until I bumped into this solution and this did it for me.Halftrack
Man, i wasted few hours trying to figure out why Textmate 2 was glitching out when I was running tests. This cleared it out.Chaffer
I needed to su/sudo to do this, since it was trying to write to /var/lib/gems. Other than that - works for jekyll.Poilu
I found this while debugging an Issue with the RubyMine debugger: Unresolved or ambiguous specs during Gem::Specification.reset for the reline gem. After the force cleanup RubyMine reinstalled the debugger gems, this time seemingly without issues.Kaneshakang
W
27

Use Bundler. Call bundle exec guard, not guard.

Workhorse answered 24/8, 2014 at 2:46 Comment(0)
A
14

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
Arbitration answered 1/6, 2017 at 6:1 Comment(0)
M
13

This worked for me:

bundle clean --force

then

bundle install

to reinstall gems.

Mesdames answered 8/10, 2017 at 3:23 Comment(0)
S
6

I use gem list gem-name; gem uninstall gem-name to clean the gem one by one because of the dependency. After that, the error does not show again.

Safire answered 21/9, 2015 at 9:36 Comment(0)
V
4

add

'bundle exec'

before your command.

I use ruby 2.4 and got the same problem when deploying jekyll on windows, it fixed.

Visitation answered 26/6, 2018 at 17:56 Comment(0)
W
1

If anyone has come this far and still hasn't found the answer I leave you with this. gem update --system. I tried all of these other answers to no avail. Hopefully this works for you.

Weinrich answered 4/3, 2021 at 23:8 Comment(0)
L
0

Remember, if you want to use guard, you have to add gem guard to Gemfile.

group :developement, :test do
  gem 'guard'
end

Then, run

bundle install

I hope this can help you.

Loser answered 7/12, 2014 at 9:14 Comment(0)
T
0

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 gemspec file:

$:.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.

Tonie answered 7/12, 2014 at 17:29 Comment(0)
M
0

Try gem uninstall <gem> and it will remove all younger versions of gem.

You will then be asked

"If you remove this gem, these dependencies will not be met. Continue deleting? [YN]"

Select the answer

"no"

to leave the latest version of gem and all dependencies remain valid.

Mantelletta answered 16/5, 2022 at 7:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.