WATIR安装失败Server 2003

时间:2010-09-04 16:54:14

标签: ruby rubygems watir activesupport

我不得不重建我的盒子,我目前无法安装Watir。

  

gem install watir
  错误:安装watir时出错:
          activesupport需要Ruby版本> = 1.8.7。

如果Watir能够使用Ruby 1.8.7,那将没有问题。我正在使用

  

ruby​​ -v
  ruby 1.8.6(2008-08-11 patchlevel 287)[i386-mswin32]
  宝石-v
  1.3.7

我不确定这种情况何时开始发生,但网站上的文档缺乏。

2 个答案:

答案 0 :(得分:4)

在Windows XP(专业版,版本2002,Service Pack 3,完全托管)上​​,我已根据ruby186-26.exe的建议从RubyForge安装了watir.com/installation

C:\>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]

C:\>gem env
RubyGems Environment:
  - VERSION: 0.9.4 (0.9.4)
  - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
  - GEM PATH:
     - c:/ruby/lib/ruby/gems/1.8
  - REMOTE SOURCES:
     - http://gems.rubyforge.org

自动RubyGems更新无效:

C:\>gem update --system
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302

我已从rubygems-update-1.3.7.gem下载RubyForge,将其复制到我打开命令提示符的文件夹(本例中为C:\)并已安装:

C:\>gem install rubygems-update-1.3.7.gem
Successfully installed rubygems-update, version 1.3.7
Installing ri documentation for rubygems-update-1.3.7...
Installing RDoc documentation for rubygems-update-1.3.7...
Could not find main page README
Could not find main page README
Could not find main page README
Could not find main page README

C:\>update_rubygems
RubyGems 1.3.7 installed
...

为了确保我拥有最新的RubyGems:

C:\>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.7
  - RUBY VERSION: 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
  - INSTALLATION DIRECTORY: c:/ruby/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: c:/ruby/bin/ruby.exe
  - EXECUTABLE DIRECTORY: c:/ruby/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mswin32-60
  - GEM PATHS:
     - c:/ruby/lib/ruby/gems/1.8
     - C:/Documents and Settings/Administrator/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

现在Watir不想安装:

C:\>gem install watir
ERROR:  Error installing watir:
        activesupport requires Ruby version >= 1.8.7.

我已将activesupport-2.3.8安装为suggested by Charley Baker,我可以安装Watir:

C:\>gem install activesupport --version="2.3.8"
Successfully installed activesupport-2.3.8
1 gem installed
Installing ri documentation for activesupport-2.3.8...
Installing RDoc documentation for activesupport-2.3.8...

C:\>gem install watir
Successfully installed firewatir-1.6.5
Successfully installed nokogiri-1.4.3.1-x86-mswin32
Successfully installed watir-1.6.5
3 gems installed
...

答案 1 :(得分:1)

我刚才有类似的问题,并认为我会对此问题添加评论。我们的开发人员目前正在运行Windows 7,因此我需要以管理员身份运行命令提示符,以便gem安装正常工作。