SciTE Environment Quandries

5 views
Skip to first unread message

Matt Goodman

unread,
Sep 8, 2008, 1:38:21 PM9/8/08
to colum...@googlegroups.com
Hello all,

I'm having an odd environment issue locally.  I am able to run a simple Watir script in IRB and Eclipse, but the same script fails in SciTE.

#Script
require 'watir'
ie = Watir::IE.new

#Error
>ruby watir.rb
./watir.rb:2: uninitialized constant Watir (NameError)
    from c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from c:/dev/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from watir.rb:1
>Exit code: 1

$LOAD_PATH output in both IRB and SciTE is initially:
c:/dev/ruby/lib/ruby/site_ruby/1.8
c:/dev/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
c:/dev/ruby/lib/ruby/site_ruby
c:/dev/ruby/lib/ruby/1.8
c:/dev/ruby/lib/ruby/1.8/i386-mswin32

However, once I require 'watir' in IRB, the load path is updated to the following:

irb(main):005:0> puts $LOAD_PATH
c:/Dev/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/vendor
c:/Dev/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib
c:/Dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/win32ole
c:/Dev/ruby/lib/ruby/gems/1.8/gems/win32-api-1.0.6-x86-mswin32-60/bin
c:/Dev/ruby/lib/ruby/gems/1.8/gems/win32-api-1.0.6-x86-mswin32-60/lib
c:/Dev/ruby/lib/ruby/gems/1.8/gems/windows-api-0.2.3/bin
c:/Dev/ruby/lib/ruby/gems/1.8/gems/windows-api-0.2.3/lib
c:/Dev/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.5/bin
c:/Dev/ruby/lib/ruby/gems/1.8/gems/windows-pr-0.8.5/lib
c:/Dev/ruby/lib/ruby/gems/1.8/gems/win32-process-0.5.8/bin
c:/Dev/ruby/lib/ruby/gems/1.8/gems/win32-process-0.5.8/lib
c:/Dev/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/bin
c:/Dev/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib
c:/Dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/bin
c:/Dev/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/.
c:/Dev/ruby/lib/ruby/site_ruby/1.8
c:/Dev/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
c:/Dev/ruby/lib/ruby/site_ruby
c:/Dev/ruby/lib/ruby/1.8
c:/Dev/ruby/lib/ruby/1.8/i386-mswin32
.
=> nil

whereas running the following in SciTE returns the same error as above: 

require 'watir'
puts $LOAD_PATH

Other team members are not having this problem and are stumped.  Any ideas what I might be missing?

Matt

Joe OBrien

unread,
Sep 8, 2008, 1:39:50 PM9/8/08
to colum...@googlegroups.com
looks like scite is messing with you and pulling a different ruby
(look at the load paths).

See if you can configure / change the load path in scite.

-Joe
_______________
Joe O'Brien, artisan
EdgeCase
theedgecase.com

614/453-5527

Matt Goodman

unread,
Sep 11, 2008, 5:08:36 PM9/11/08
to colum...@googlegroups.com
Thanks Joe

If SciTE has a way to edit the load path, I have yet to find it.

Since first posting, I've removed my working copy of ruby, tests, and uninstalled and reinstalled tortoise svn (that was somewhat of a tangent) hoping to clear up the SciTE issue - I now have different, but just as useless issues when requiring watir.  Non-watir gems are updating the load path correctly when required.  I'm setting this aside for now.

Matt

Joe OBrien

unread,
Sep 11, 2008, 5:12:02 PM9/11/08
to colum...@googlegroups.com
Honestly, I have never heard a good word spoken about scite other than 'it comes with the windows build'

I would seriously think about using something much simpler for what you are trying to do (UltraEdit, CrimsonEditor come to mind ... Emacs for the advanced, VI for the remedial).  If you need IDE support, or want more features I would look heavily at NetBeans.  It seems to have the most traction and features for that crowd.

-Joe 
_______________
Joe O'Brien, artisan
EdgeCase


Ryan Briones

unread,
Sep 12, 2008, 12:05:20 AM9/12/08
to colum...@googlegroups.com
is it possible your script should actually be:

require 'rubygems'
require 'watir'
ie = Watir:IE.new
--
Ryan Carmelo Briones

Matt Goodman

unread,
Sep 12, 2008, 10:39:02 AM9/12/08
to colum...@googlegroups.com
Unfotunately, that doesn't seem to be the problem - the same result is returned with or without gems required.  Other gems actually work as I would expect them (as far as the load path updates are concerned)  - i.e.:

#require 'rubygems'
#require 'watir'
require 'capistrano'
puts $LOAD_PATH

>ruby watir.rb
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/bin
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/bin
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-sftp-2.0.1/lib
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-scp-1.0.1/bin
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-scp-1.0.1/lib
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-ssh-gateway-1.0.0/bin
c:/dev/ruby/lib/ruby/gems/1.8/gems/net-ssh-gateway-1.0.0/lib
c:/dev/ruby/lib/ruby/gems/1.8/gems/highline-1.4.0/bin
c:/dev/ruby/lib/ruby/gems/1.8/gems/highline-1.4.0/lib
c:/dev/ruby/lib/ruby/gems/1.8/gems/capistrano-2.4.3/bin
c:/dev/ruby/lib/ruby/gems/1.8/gems/capistrano-2.4.3/lib

c:/dev/ruby/lib/ruby/site_ruby/1.8
c:/dev/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
c:/dev/ruby/lib/ruby/site_ruby
c:/dev/ruby/lib/ruby/1.8
c:/dev/ruby/lib/ruby/1.8/i386-mswin32
.
>Exit code: 0

The different output I referred to earlier with watir (it's no longer returning the error originally reported) is a duplication of the standard ruby load path:

#require 'rubygems'
require 'watir'
#require 'capistrano'
puts $LOAD_PATH

>ruby watir.rb

c:/dev/ruby/lib/ruby/site_ruby/1.8
c:/dev/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
c:/dev/ruby/lib/ruby/site_ruby
c:/dev/ruby/lib/ruby/1.8
c:/dev/ruby/lib/ruby/1.8/i386-mswin32
.

c:/dev/ruby/lib/ruby/site_ruby/1.8
c:/dev/ruby/lib/ruby/site_ruby/1.8/i386-msvcrt
c:/dev/ruby/lib/ruby/site_ruby
c:/dev/ruby/lib/ruby/1.8
c:/dev/ruby/lib/ruby/1.8/i386-mswin32
.
>Exit code: 0

^^ That's just weird.

I'm new to development and therefore (obviously) new to ruby - as such, I've appreciated the feedback! 

Matt
Reply all
Reply to author
Forward
0 new messages