今天学习ruby,下载了ruby并安装,之后参考相关入门教程开始第一个小程序,在命令行直接运行:
ruby -e "print 'hello, yiditushe'",回车之后,提示如下错误:
C:\Documents and Settings\yiditushe>ruby -e "print 'hello, world'"
C:/Ruby/lib/ruby/1.8/date.rb:197:in `require': no such file to load -- date/format (LoadError)
from C:/Ruby/lib/ruby/1.8/date.rb:197
from C:/Ruby/lib/ruby/1.8/yaml/rubytypes.rb:2:in `require'
from C:/Ruby/lib/ruby/1.8/yaml/rubytypes.rb:2
from C:/Ruby/lib/ruby/1.8/yaml.rb:396:in `require'
from C:/Ruby/lib/ruby/1.8/yaml.rb:396
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:7:in `require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/config_file.rb:7
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:882:in `require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:882
from C:/Ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10:in `require'
from C:/Ruby/lib/ruby/site_ruby/1.8/ubygems.rb:10
开始在网上查了下资料,说是C:\Ruby\lib\ruby\1.8\date\目录下的format.rb不存在导致的,但我到该目录下查看,发现该文件存在,但是我用UE不能打开它,提示如下:
又到其它目录看用同样方法打开其它的文件,发现可以打开。这下就奇怪了。左想右想,又是卸载又是重新安装,还是不行。折腾了几个小时后,最后居然发现当我把McAfee的按访问扫描关闭后,文件可以正常打开!
再次运行那个程序,成功了!晕,McAfee这也行。
C:\Documents and Settings\yiditushe>ruby -e "print 'hello, world'"
hello, world
C:\Documents and Settings\yiditushe>
以后运行ruby程序就只好把McAfee关闭咯。还没找到可以修改McAfee的什么配置。