just_add_watir | Advanced recipes for Watir
28Jul/08Off

Q. How do I gem install Watir behind a proxy server?

A. Set an environment variable for your proxy from the command line ...

set HTTP_PROXY=http://my.work.proxy:8080
gem install watir
Tagged as: Comments Off
Comments (3) Trackbacks (0)
  1. OK but what if the proxy is dynamically assigned by an automatic configuration script? To install the latest version of Watir on WinXP I resorted to manually downloading all the gems from rubyforge.org, then installing in this sequence

    rubygems-update-1.2.0.gem
    win32-api-1.1.0-x86-mswin32-60.gem
    windows-api-0.2.4.gem
    windows-pr-0.8.7.gem
    win32-process-0.5.9.gem
    activesupport-2.1.0.gem
    watir-1.5.6.gem

  2. Correct, downloading the gems then installing locally using a batch file has been the only way I can install Watir behind an authenticating proxy server (or one that uses a PAC script).

    Thanks for highlighting this.

    Regards,
    Tim Koopmans

  3. PS. Here is the batch file code to do a standalone installation. You need to make sure you have the most current
    gems from rubyforge e.g.
    E:\apps\watir>ls
    1_win32-api-1.2.0-x86-mswin32-60.gem 5_win32-clipboard-0.4.4.gem
    2_windows-api-0.2.4.gem activesupport-2.1.1.gem
    3_windows-pr-0.9.3.gem install.bat
    4_win32-process-0.5.9.gem watir-1.5.6.gem

    Then your batch file should look like this:
    @echo off
    FOR /F “tokens=1″ %%G IN (‘dir *win*.gem /B /ON’) DO gem install %%G
    FOR /F “tokens=1″ %%G IN (‘dir *activesupport*.gem /B /ON’) DO gem
    install %%G
    FOR /F “tokens=1″ %%G IN (‘dir *watir*.gem /B /ON’) DO gem install %%G

Trackbacks are disabled.