NoMethodError: undefined `spec 'method for nil: NilClass - active_utils, factory_girl and more stones that fail

Out of nowhere and without changing anything, I began to get this error (and other people on the team).

This happens for some gems (those that point to the git branch), and only happens when we recreate the environment (in a stray state). We have not changed anything.

Any ideas? Additional Information:

Using active_utils (2.0.0) from git://github.com/Shopify/active_utils.git (at v2.0.0) NoMethodError: undefined method `spec' for nil:NilClass An error occurred while installing active_utils (2.0.0), and Bundler cannot continue. Make sure that `gem install active_utils -v '2.0.0'` succeeds before bundling. Using factory_girl (2.6.5) from https://github.com/thoughtbot/factory_girl (at 2.6.x) NoMethodError: undefined method `spec' for nil:NilClass An error occurred while installing factory_girl (2.6.5), and Bundler cannot continue. Make sure that `gem install factory_girl -v '2.6.5'` succeeds before bundling. 
  • Running "gem install active_utils -v" 2.0.0 "works, but linking always fails.
  • Cleared cache but didn't help

It seems that all entries in the Gemfile indicate the branch that started the crash.

 gem 'active_utils', :git => 'git://github.com/Shopify/active_utils.git', :branch => 'v2.0.0' gem "will_paginate", :git => "git://github.com/mislav/will_paginate.git", :branch => "2-3-stable" 
+6
source share
2 answers

So it turns out that this was caused by a recent RubyGems update. Forced work of the previous version.

 gem update --system 2.4.8 
+13
source

Although there is already an accepted answer, I ran into the same problem.

Ultimately, the reason is that I used an outdated version of the provider and upgraded it to the latest version. More error information here: https://github.com/bundler/bundler/issues/3560

The error occurs before package version 1.9.3.

You can update the bundler by running gem install bundler and then uninstall the older version of the provider via gem uninstall bundler -v old.bundler.version

If you use rvm, I recommend installing this on the global gemset of your current ruby ​​version by running rvm use @global before completing the installation.

+1
source

All Articles