1

I had to rebuild my box and I currently am unable to install Watir.

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

Which would be fine if Watir was able to use Ruby 1.8.7 . I am using

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

I am not sure when this started to occur, but the documentation on the site is lacking.

4

2 回答 2

4

在 Windows XP(专业版,2002 版,Service Pack 3,完全路径化)上,我已按照 watir.com/installation的建议从RubyForge安装了 ruby ​​186-26.exe

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

我从RubyForge下载了 ruby​​gems-update-1.3.7.gem,将其复制到我打开命令提示符的文件夹(在本例中)并安装: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.

我已经按照Charley Baker的建议安装了 activesupport-2.3.8 ,并且能够安装 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
...
于 2010-09-06T12:03:37.907 回答
1

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

于 2011-05-19T18:54:41.407 回答