2010-09-04 109 views
1

我不得不重建我的盒子,我目前無法安裝Watir。WATIR安裝失敗Server 2003

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

如果Watir能夠使用Ruby 1.8.7,那將會很好。我使用

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

我不知道什麼時候開始的發生,但缺乏在網站上的文檔。

回答

4

在Windows XP(Professional,Version 2002,Service Pack 3,完全路徑)我已經安裝ruby186-26.exeRubyForge,建議在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 

我從RubyForge下載rubygems-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. 

我已經安裝的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 
... 
+0

從網站下載Rubygems而不是從Ruby方式下載。此外,這對watir有什麼幫助? – Woot4Moo 2010-09-06 12:21:03

+0

對不起,我在調查過程中保存了答案,如果我的瀏覽器崩潰了(或其他),我不想丟失它。我已經用解決方案更新了答案。 – 2010-09-06 12:27:28

+0

所有的真正修復:$ gem install activesupport --version =「2.3.8」 – rogerdpack 2010-09-07 17:09:34

1

我也有類似剛纔問題,並認爲我會在這個問題上添加評論。我們的開發者vm目前正在運行windows 7,因此我需要以管理員身份運行我的命令提示符以使gem安裝正常工作。