NoMethodError:nil:NilClass的未定义方法'spec'-active_utils,factory_girl和更多gems失败 [英] NoMethodError: undefined method `spec' for nil:NilClass - active_utils, factory_girl and more gems failing

查看:44
本文介绍了NoMethodError:nil:NilClass的未定义方法'spec'-active_utils,factory_girl和更多gems失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无处不在,并且没有进行任何更改,我已经开始收到此错误(团队中的其他人也是如此).

Out of nowhere, and without changing anything, I've started getting this error (and so did other people on the team).

这在某些gems(指定git分支的gems)中发生,并且仅在我们重新创建环境时(在无业游民中)发生.我们什么都没改变.

This is happening for some gems (the ones specifying a git branch) and is only happening when we recreate the environment (in vagrant). We didn't change anything.

有什么想法吗?更多信息如下:

Any ideas? More info follows:

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.

  • 运行"gem install active_utils -v'2.0.0'"有效,但始终捆绑失败.
  • 清除了宝石缓存,但没有帮助
  • 似乎Gemfile中的所有条目都指定了开始失败的分支.

    Seems like it's all entries in Gemfile specifying a branch that started failing.

    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"
    

    推荐答案

    因此,事实证明,这是由于最近升级到RubyGems引起的.强制使用以前的版本.

    So, turns out this was caused because of a recent upgrade to RubyGems. Forcing a previous version worked.

    gem update --system 2.4.8
    

    这篇关于NoMethodError:nil:NilClass的未定义方法'spec'-active_utils,factory_girl和更多gems失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆