2012-02-08 77 views
0

我想結合使用webrat和Cucumber爲Web應用程序編寫驗收測試。當我嘗試安裝webrat gem時,出現以下錯誤。我試圖刪除C:\ Ruby193 \ lib \ ruby​​ \ gems \ 1.9.1 \ cache *和gem update --system,但沒有任何運氣。使用Ruby 1.9.3和Rubygems 1.8.15安裝webrat

我想在Windows7環境中安裝Ruby上的gem。據我可以看到問題是這樣的:「在C:/Ruby193/lib/ruby/gems/1.9.1/cache/webrat-0.7.3.gem找不到元數據」

任何幫助是非常感謝,謝謝!

gem install webrat --debug 
Exception `NameError' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand 
Exception `Errno::EWOULDBLOCK' at C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:141 - A non-blocking socket operation could not be completed immediately. - read would block 
Exception `Errno::EWOULDBLOCK' at C:/Ruby193/lib/ruby/1.9.1/net/protocol.rb:141 - A non-blocking socket operation could not be completed immediately. - read would block 
Exception `NoMethodError' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1483 - undefined method `to_ary' for #<Gem::Specification name=webrat version=0.7.3> 
Exception `NoMethodError' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1483 - undefined method `to_ary' for #<Gem::Specification name=webrat version=0.7.3> 
Exception `Errno::EEXIST' at C:/Ruby193/lib/ruby/1.9.1/fileutils.rb:247 - File exists - C:/Ruby193/lib/ruby/gems/1.9.1 
Exception `Gem::Package::FormatError' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb:122 - no metadata found in C:/Ruby193/lib/ruby/gems/1.9.1/cache/webrat-0.7.3.gem 
Exception `Gem::InstallError' at C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:121 - invalid gem format for C:/Ruby193/lib/ruby/gems/1.9.1/cache/webrat-0.7.3.gem 
ERROR: Error installing webrat: 
     invalid gem format for C:/Ruby193/lib/ruby/gems/1.9.1/cache/webrat-0.7.3.gem 
+0

我對我的Win7機器上的rubygems 1.8.17沒有問題。你嘗試過'update_rubygems'還是你鎖定到1.8.15? – ScottJShea 2012-02-26 22:31:38

+0

謝謝你的回覆:) Webrat做的工作,所以我改變了。問題解決了。 – 2012-03-05 10:05:38

+0

然後我將它移動到一個答案! – ScottJShea 2012-03-05 13:28:18

回答