4
我想使用FakeFS但不断收到未初始化的常数错误,当我require 'fakefs'
:未初始化的常量文件:: NOCTTY错误“fakefs”
C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs/file.rb:26:in `<class:File>': uninitialized constant File::NOCTTY (NameError)
我的RubyMine最初的工作,但隔离我写了一个简单的hello world脚本并从命令行运行它的问题,仍然得到相同的错误。下面是该脚本:
require 'rubygems'
gem 'fakefs'
require 'fakefs'
puts "Hello Cleveland!"
这里是错误和相应的堆栈跟踪:
>ruby foo.rb
C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs/file.rb:26:in `<class:File>': uninitialized constant File::NOCTTY (NameError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs/file.rb:4:in `<module:FakeFS>'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs/file.rb:3:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs/safe.rb:9:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/fakefs-0.3.1/lib/fakefs.rb:1:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from foo.rb:3:in `<main>'
我通过的RubyMine安装fakefs宝石。我正在使用Ruby 1.9开发Windows。有任何想法吗?
并称方法做的伎俩。还要感谢您指出了Windows修补程序的问题。 – ThisSuitIsBlackNot 2011-04-17 20:36:08