【问题标题】:rspec 'no such file to load'rspec '没有要加载的文件'
【发布时间】:2012-07-20 11:30:07
【问题描述】:

我有一个烦人的问题,即 rspec gem 安装在我的机器上,但是当我需要它时,我收到“没有要加载的此类文件”错误。跟踪如下所示。这个问题似乎在极少数情况下也会消失,然后很快就会出现。任何帮助将不胜感激。我正在使用 IronRuby,但在 Ruby 中似乎也发生了同样的情况。

   C:\Users\MicalM02>igem list

   *** LOCAL GEMS ***

   builder (3.0.0)
   ci_reporter (1.7.0)
   cucumber (0.6.3)
   diff-lcs (1.1.3)
   iron-term-ansicolor (0.0.3)
   json_pure (1.7.3)
   polyglot (0.3.3)
   rake (0.9.2.2)
   rspec (2.11.0)
   rspec-core (2.11.0)
   rspec-expectations (2.11.1)
   rspec-mocks (2.11.1)
   term-ansicolor (1.0.7)
   treetop (1.4.10)

   C:\Users\MicalM02>ir
   IronRuby 1.1.3.0 on .NET 4.0.30319.269
   Copyright (c) Microsoft Corporation. All rights reserved.

   >>> require "rubygems"
   => true
   >>> require "spec/expectations"
    d:/Program Files (x86)/IronRuby 1.1/Lib/ruby/1.9.1/rubygems/custom_require.rb:29
    :in `require': no such file to load -- spec/expectations (LoadError)
            from d:/Program Files (x86)/IronRuby 1.1/Lib/ruby/1.9.1/rubygems/custom_
    require.rb:29:in `require'
           from (ir):1

    >>>

【问题讨论】:

  • 我可以在 ironruby 的 gem 列表 (igem list) 中看到您的 gem 列表,但我发现 Ironruby 有时会将自己配置为查看您的 MRI gem 列表(即:gem list)铁红宝石...您的 MRI 宝石列表中有什么?
  • 谢谢纳特。我会在星期一看看,但我很确定它们是不同的。
  • 如果它们不同,请确保在两个位置都安装了正确版本的 rspec

标签: ruby rspec ironruby


【解决方案1】:

它是: 需要“rspec/expectations”

你缺少一个“r”

【讨论】:

  • 我注意到了,但我从其他人那里继承了这段代码,并且它在他的机器上运行。也许这是一个 gem 版本控制问题?
  • @Mark,我想是的。旧版本的 rspec 对可执行文件(以及可能的库)使用“规范”;较新的版本使用“rspec”。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-07
相关资源
最近更新 更多