使用 Ruby 1.9.3 和 Rubygems 1.8.15 安装 webrat

发布于 2025-01-03 19:35:40 字数 1809 浏览 0 评论 0原文

我想将 webrat 与 Cucumber 结合使用来为 Web 应用程序编写验收测试。当我尝试安装 webrat gem 时,出现以下错误。我尝试删除 C:\Ruby193\lib\ruby\gems\1.9.1\cache* 和 gem update --system 但没有任何运气。

我正在尝试在 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

I want to use webrat in combination with Cucumber for writing acceptance tests for a web application. When I try to install the webrat gem I get the error stated below. I have tried to delete C:\Ruby193\lib\ruby\gems\1.9.1\cache* and a gem update --system without any luck.

I am trying to install the gem on Ruby in a Windows7 environment. As far as I can see the problem is related to this: "no metadata found in C:/Ruby193/lib/ruby/gems/1.9.1/cache/webrat-0.7.3.gem"

Any help is much appreciated, thank you!

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最丧也最甜 2025-01-10 19:35:40

看起来更新到 Rubygems 1.8.17 可以解决这个问题。 OP使用了update_rubygems

Looks as though updating to Rubygems 1.8.17 takes care of the issue. OP used update_rubygems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文