Unresolved specs during Gem::Specification.reset: - ruby

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'

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).

Using the following command solved it for me:
bundle clean --force
See guard-and-unresolved-specs for more info

Use Bundler. Call bundle exec guard, not guard.

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

This worked for me:
bundle clean --force
then
bundle install
to reinstall gems.

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.

add
'bundle exec'
before your command.
I use ruby 2.4 and got the same problem when deploying jekyll on windows, it fixed.

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.

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.

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.

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.

Related

toy/doc undefined method 'available?'

I'm attempting to build local Ruby documentation as suggested here:
https://github.com/toy/doc
However when I use the default Rakefile I get the following:
[Documentation]$ rake build
configuring and updating: 100.0%
rake aborted!
undefined method `available?' for Gem:Module
/Users/snowcrash/.rvm/gems/ruby-2.0.0-p195/gems/sdoc-0.2.20/lib/sdoc/json_backend.rb:9:in `<top (required)>'
Any suggestions?
I don't know much about ruby (and even less about the gem ecosystem built up around it), but I believe a possible workaround for this issue is to find what gems the project requires and manually install them. In the case of this particular project, it looks like you need the gem "fspath".
At the project root, type
gem install fspath
and try re-running rake.
I honestly don't know the actual root cause of the issue, other than that presumably, your version of the 'gem' program is probably > v2, while some other program (rake?) expects it to be older and still support the "available?" method.
If installing "fspath" doesn't fix the issue, you could try downgrading your version of gem by doing
gem install -v [some version of gem older than v2]
Check gem install --help for more info on this.
This is just for future visitor who has the same issue.
As ekremkaraca said, you can just solve this by downgrading rubygems.
rvm install --force rubygems 1.4.2

bundle install mongoid, mongoid_ext error

I get this error when I run bundle install to install Shapado. What does it mean? and how to fix it?
Could not find gem 'mongoid (~> 3) ruby', which is required by gem 'mongoid_ext (>= 0) ruby', in any of the sources.
We cannot provide exact answers unless you show us your Gemfile. In the meantime, you can try to
Check your Gemfile for typos (missing commas, additional spaces inside the gem names)
Delete Gemfile.lock and run bundle install again
When i download the latest version of shapado and try to bundle install i get a similar error, but for the twitter gem:
Could not find twitter-1.7.2 in any of the sources
It seems Shapado is a bit out of date and has not seen any commits for quite a while…

Can I control the version of rubygems that IntelliJ uses?

I'm trying to start a rails application in IntelliJ with the Ruby plugin.
I've imported the application and set up the run configuration as best I can. When I try to run it I get the error:
NoMethodError: undefined method `version_requirements' for #<Gem::Dependency:0x7de21f45>
When looking for an answer I found this page saying that I should do this:
$ gem install rubygems-update -v='1.4.2'
$ gem uninstall rubygems-update -v='1.5.0'
$ update_rubygems
Since it's IntelliJ's ruby plugin that is managing the gems, I assume that I have to change the version of rubygems-update that the plugin is using.
Is this the right approach to take? And if so, can anyone tell me how to go about it?
I tried listing the gems but that gem is not shows so I must not be listing the gems in the right place, but I don't know where to look.
Many thanks :)
IntelliJ IDEA cannot handle it, you will need to install the appropriate rubygems version from the command line.
Note that your current rubygems-update version may be different, verify it with gem list and use the reported version when uninstalling.

Having trouble installing Autotest in Rails in Ubuntu 10.10 enviroment

I'm learning how to program in Rails. I'm a complete newbie, and I'm learning from the screen-cast "Rails Tutorial: Learn by Example" by Michael Hartl.
I've been doing pretty well, until I've come to this obstacle, and I don't know how to figure it out. It's a bit frustrating to be frank, and I'd like to move forward with Rails & start making stuff :)
I installed RubyGems 1.8.5 by hitting:
$ gem update --system
and then installed ZenTest gem by hitting:
$ sudo gem install ZenTest
then I installed auto-test rails gem by hitting:
$ sudo gem install autotest-rails
and so got the message
Successfully installed autotest-rails-4.1.0
1 gem installed
Installing ri documentation for autotest-rails-4.1.0...
Installing RDoc documentation for autotest-rails-4.1.0...
So all was lookin' fine and dandy. I navigated to my app folder, and hit
$ autotest
and then got the message
/usr/local/lib/ruby/1.9.1/rubygems.rb:762:in `report_activate_error': Could not find RubyGem ZenTest (>= 0) (Gem::LoadError)
from /usr/local/lib/ruby/1.9.1/rubygems.rb:219:in `activate'
from /usr/local/lib/ruby/1.9.1/rubygems.rb:1065:in `gem'
from /usr/local/bin/autotest:18:in `<main>'
I've tried searching for an answer to why this is happening, but I can't find any. Please help me solve this problem. I'd like to move forward with learning Rails :)
EDIT Maybe I should also mention that I have RSpec installed already -- I don't know if that's of any significance -- giving you a better understanding as to whats going on with my problem -- but I thought I'd just put it out there.
Cheers.
Are you using Rails 3+? If so look for a file called Gemfile inside the rails app root directory. Open it up, add:
gem 'ZenTest'
gem 'autotest-rails'
Save, exit and then run from command line:
bundle
After this try rerunning autotest
I'm at the same point of learning RoR (in this case RoR 3.0.3, Ruby 1.9.2p180, Ubuntu 11.04). I'm also stymied by the lack of consistency. In my case:
$ "You don't have i18n installed in my application. Please add it to your Gemfile and run bundle install".
Gemfile:
gem 'ZenTest'
gem 'autotest-rails'
gem 'i18n'
$bundle install => OK
$bundle show i18n => <ruby path>/gems/i18n-0.6.0
$autotest => (same result)
Any ideas? This is NOT going to help RoR adoption, if it's so obtuse to load a basic TDD environment. (I'll step off my soapbox now.)
try in command line "bundle install"

Bundler can't find Ruby gem that appears on website

I installed Bundler on a pre-Rails 3 application and am trying to use it to install gems. My Gemfile contains the following lines:
source :rubygems
[...]
gem "RubyInline", "3.8.1"
However, when I run bundle install I get this error:
Fetching source index for http://rubygems.org/
Could not find gem 'RubyInline', required by 'memcache-client (= 1.6.3)', in any of the sources
The gem appears on the rubygems website:
http://rubygems.org/gems/RubyInline
Why is it giving me an error then?
I'm afraid this resolved itself after changes to fix other issues, and I'm not sure what the fix was. The source of several other issues was wrong permissions on various gems/binaries.
This kind of issue for me seems to be resolved on occasion by applying
bundle update
before
bundle install
The effect is to resolve old dependencies from when the bundle was originally produced and hence a gem that has been superseded (or whatever) will no longer be in the Gemfile.

Resources