Ruby - watir : Failed to get IEnum Interface - ruby

I'm using windows XP and I need to use watir with ruby, the installation went pretty well, my last try was following the instructions here Failed WATIR installation Server 2003 and everything was ok except for this "ERROR: While generating documentation for builder-2.1.2" then the installation finished with no more problems.
The problem is when I try to run a sample script to execute a google search I got an error when the set function is called, so far I haven't found any useful information about it, if anyone could give me a hand it would be great :)
btw, here http://www.mail-archive.com/wtr-general#rubyforge.org/msg07722.html they say that it is related to WIN32OLE but they don't explain how to fix it (or at least I didn't get it :s )
The versions I've installed are
ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
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/jamontoya/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
The error
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/locator.rb:119:in `each': failed to get IEnum Interface (RuntimeError)
HRESULT error code:0x80004002
No such interface supported from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/locator.rb:119:in `locate'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/container.rb:838:in `locate_input_element'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/input_elements.rb:5:in `locate'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:54:in `assert_exists'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:315:in `enabled?'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/element.rb:62:in `assert_enabled'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/input_elements.rb:364:in `set'
from Search.rb:29
The sample code (Search.rb)
I removed comments and other unnecessary lines
require "watir"
test_site = "http://www.google.com"
browser = Watir::Browser.new
browser.goto test_site
browser.text_field(:name, "q").set("pickaxe") # here is the error when set is called
browser.button(:name, "btnG").click
browser.close
gem list
just in case you need to know
*** LOCAL GEMS ***
activesupport (2.3.9)
builder (2.1.2)
commonwatir (1.6.6)
firewatir (1.6.6)
fxri (0.3.6)
fxruby (1.6.12 mswin32)
hoe (2.6.2)
hpricot (0.6 mswin32)
json_pure (1.4.6)
log4r (1.0.5)
nokogiri (1.4.3.1 x86-mswin32)
rake (0.8.7, 0.7.3)
rubyforge (2.0.4)
rubygems-update (1.3.7)
s4t-utils (1.0.4)
sources (0.0.1)
user-choices (1.1.6.1)
watir (1.6.6)
win32-api (1.4.6 x86-mswin32-60, 1.0.4 mswin32)
win32-clipboard (0.4.3)
win32-dir (0.3.2)
win32-eventlog (0.4.6)
win32-file (0.5.4)
win32-file-stat (1.2.7)
win32-process (0.6.2, 0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.4.0, 0.2.0)
windows-pr (1.0.9, 0.7.2)
xml-simple (1.0.12)

Watir can't find IEnum interface thread that you link to says:
my best suggestion is to uninstall and
reinstall Ruby, then re-install Watir
on top of the new Ruby
and that would be my advice too.

Related

Ruby issue with Bundler::GemNotFound

I've a problem with every gem I try to use.
I am using an Ubuntu machine.
The error is
/usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize': Could not find chunky_png-1.3.6 in any of the sources (Bundler::GemNotFound)
The error is not specific to that gem, because it happen with different gem as well. I think is a path problem.
I've already tried to reinstall ruby. Any help will be very appreciate.
My environment:
$ ruby -v
ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]
$ bundle env
Bundler 1.12.5
Rubygems 2.6.6
Ruby 2.1.10p492 (2016-04-01 revision 54464) [x86_64-linux]
GEM_HOME /usr/local/bundle
GEM_PATH
Git 2.1.4
$ gem environment
- RUBYGEMS VERSION: 2.6.6
- RUBY VERSION: 2.1.10 (2016-04-01 patchlevel 492) [x86_64-linux]
- INSTALLATION DIRECTORY: /usr/local/bundle
- USER INSTALLATION DIRECTORY: /root/.gem/ruby/2.1.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bundle/bin
- SPEC CACHE DIRECTORY: /root/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /usr/local/bundle
- /root/.gem/ruby/2.1.0
- /usr/local/lib/ruby/gems/2.1.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-document"
- "update" => "--no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bundle/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
List of gems
*** LOCAL GEMS ***
bigdecimal (default: 1.2.4)
bundler (1.12.5)
chunky_png (1.3.6)
compass (1.0.3)
compass-core (1.0.3)
compass-import-once (1.0.5)
ffi (1.9.14)
io-console (default: 0.4.3)
json (default: 1.8.1)
minitest (default: 4.7.5)
multi_json (1.12.1)
psych (default: 2.0.5)
rake (default: 10.1.0)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rdoc (default: 4.1.0)
rubygems-update (2.6.6)
sass (3.4.22)
test-unit (default: 2.1.10.0)
I found a solution to this to install the gems without sudo. It seems on my machine there were two locations for the gems, and when I installed via sudo, it placed them in the wrong location. Installing with gem install compass for instance placed it in the correct location.

unable to find gems after switching to rbenv

was hoping would be able to help me with an issue I am having since I switched from using rvm to rbenv. Company I work for has started using Boxen to manage the developments environments and this is not compatible with rvm hence the switch.
Anyways my problem is after the switch some of my gems are not found. for example capybara webkit. I have added this to my gem file, ran bundler and all gems are installed as expected. I then did an ebenv rehash to installs shims for the the new gems.
However when I attempt to run my tests I get the error:
no such file to load -- capybara-webkit (LoadError)
my gem list is as follows:
Using mime-types (2.0)
Using mini_portile (0.5.2)
Using nokogiri (1.6.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using xpath (2.0.0)
Using capybara (2.1.0)
Using json (1.8.1)
Using capybara-webkit (1.0.0)
Using ffi (1.8.1)
Using childprocess (0.3.9)
Using cliver (0.2.2)
Using diff-lcs (1.2.4)
Using zip (2.0.2)
Using jar_wrapper (0.1.7)
Using multi_json (1.7.4)
Using websocket-driver (0.3.0)
Using poltergeist (1.4.1)
Using rspec-core (2.13.1)
Using rspec-expectations (2.13.0)
Using rspec-mocks (2.13.0)
Using rspec (2.13.0)
Using rubyzip (0.9.9)
Using selenium (0.2.10)
Using websocket (1.0.7)
Using selenium-webdriver (2.32.1)
Using bundler (1.3.5)
my ruby gem environment is:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2013-06-27 patchlevel 448) [x86_64-darwin12.4.0]
- INSTALLATION DIRECTORY: /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: /opt/boxen/rbenv/versions/1.9.3-p448/bin/ruby
- EXECUTABLE DIRECTORY: /opt/boxen/rbenv/versions/1.9.3-p448/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /opt/boxen/rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1
- /Users/Gerry/.gem/ruby/1.9.1
- /opt/boxen/rbenv/plugins/rbenv-gem-rehash
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "gem" => "--no-ri --no-rdoc"
- REMOTE SOURCES:
- http://rubygems.org/
I believe that the issue may have something to do with my path. I am using zsh and have added the following to my .zshrc as per the instructions at (https://github.com/sstephenson/rbenv)
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
When I run the command echo $PATH i get the following:
/opt/boxen/rbenv/shims:/Users/Gerry/.rbenv/bin:node_modules/.bin:/opt/boxen/nodenv/shims:/opt/boxen/nodenv/bin:bin:/opt/boxen/rbenv/shims:/opt/boxen/rbenv/bin:/opt/boxen/rbenv/plugins /ruby-build/bin:/opt/boxen/bin:/opt/boxen/homebrew/bin:/opt/boxen/homebrew/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/Gerry/Sites/EventMobi/Code/ec2-api-tools-1.6.1.3/bin:/usr/local/share/npm/bin
Anybody got any idea what I am doing wrong?
OK, managed to get this working. Not sure what the fix was I just ran rbenv rehash a few times and I no longer get the error message. All gems are found as expected.

firefox and watir wouldn't work on windows due to a singularize method not found, what's wrong?

I just installed a fresh copy of ruby 1.8.7 on Windows XP SP3 32bits.
Install watir.
I used the wikipedia example :
require 'rubygems'
require 'watir/ie'
Watir::Browser.default = 'ie'
b = Watir::Browser.new
b.goto("http://www.google.com")
so far so good, works as expected
now
require 'rubygems'
require 'watir/ie'
Watir::Browser.default = 'firefox'
b = Watir::Browser.new
b.goto("http://www.google.com")
throws an ugly
C:\Documents and Settings\Administrator\Desktop>ruby watir2.rb
C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/browser.rb:89:in `
klass': undefined method `singularize' for "Buttons":String (NoMethodError)
from C:/Ruby187/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ele
ment_collections.rb:185
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
from C:/Ruby187/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir.rb:
29
from (eval):1:in `klass'
from C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/brows
er.rb:65:in `eval'
from C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/brows
er.rb:89:in `klass'
from C:/Ruby187/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/brows
er.rb:65:in `new'
from watir2.rb:7
It should be mentioned that i have followed the procedure documented there http://watir.com/installation/#win
besides, I think it's unrelated but I do have the jssh firefox plugin installed as expected.
what's does this undefined method `singularize' stands for ?
below is some environment info
C:\Documents and Settings\Administrator\Desktop>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby187/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/Ruby187/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby187/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby187/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/
C:\Documents and Settings\Administrator\Desktop>gem list
*** LOCAL GEMS ***
activesupport (3.0.0)
builder (2.1.2)
commonwatir (1.6.5)
firewatir (1.6.5)
hoe (2.6.1)
json_pure (1.4.6)
nokogiri (1.4.3.1 x86-mingw32)
rake (0.8.7)
rubyforge (2.0.4)
s4t-utils (1.0.4)
user-choices (1.1.6.1)
watir (1.6.5)
win32-api (1.4.6 x86-mingw32)
win32-process (0.6.2)
windows-api (0.4.0)
windows-pr (1.0.9)
xml-simple (1.0.12)
C:\Documents and Settings\Administrator\Desktop>
Wikipedia article is not maintained by Watir team, so it is probably not up to date. Please use only examples from watir.com.
I took a look at Wikipedia article and I could not find require 'watir/ie' anywhere, please use just require 'watir'.
I have installed Ruby 1.8.7-p302 from rubyinstaller.org/downloads on a fully patched XP SP3 32 bit machine, and installed Watir with gem install watir.
I have installed Firefox 3.6.8 and Windows plugin for Firefox 3.6 from watir.com/installation.
I have executed code from watir.com/examples
require "rubygems"
require "watir"
Watir::Browser.default = "firefox"
Watir::Browser.new
but I got
NoMethodError: undefined method `demodulize' for "FireWatir::Pre":String
from C:/Ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/browser.rb:89:in `klass'
from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/elements/non_control_elements.rb:2
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir.rb:15
from (eval):1:in `klass'
from C:/Ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/browser.rb:65:in `eval'
from C:/Ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/browser.rb:89:in `klass'
from C:/Ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.5/lib/watir/browser.rb:65:in `new'
from (irb):4
Really strange. That used to work.
If you want to drive Firefox with Watir, I would suggest watir-webdriver gem until this is fixed.
Just do require 'active_support' somewhere in your code. Looks like the guys didn't specify active_support as dependency. add rant here
works for me with 1.8.6 (mingw) + active_support 2.3.8 + watir (though I get a "please install jssh" message when I use it with firefox).
My first hunch is that you have some conflict among gems, and rubygems "always chooses the first"
You could install the gem_conflict_checker gem (which includes a rubygems plugin to test for the same). Install it then install the watir gem and it should tell you of existing conflict.
In answer to your original question, here's singularize: http://blog.jayfields.com/2007/11/stringsingularize.html
-r

Rubygems Path Question

I am trying to run the following ruby code from IRB but am unable to require the gmail gem.
require 'rubygems'
require 'gmail'
gmail = Gmail.new("user", "pass")
Here's the IRB output:
Johnny-Goodmans-MacBook-Pro:gmail johnnygoodman$ irb
>> require 'rubygems'
=> false
>> require 'gmail'
NameError: uninitialized constant Gmail
from ./gmail.rb:6
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from (irb):2
Here is Gem.path output:
>> Gem.path
=> ["/Users/johnnygoodman/.gem/ruby/1.8", "/Library/Ruby/Gems/1.8", "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8"]
And environment output:
Johnny-Goodmans-MacBook-Pro:gmail johnnygoodman$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.7 (2009-06-08 patchlevel 173) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/johnnygoodman/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://rubygems.org/", "http://gems.github.com"]
- REMOTE SOURCES:
- http://rubygems.org/
- http://gems.github.com
And which ruby:
Johnny-Goodmans-MacBook-Pro:gmail johnnygoodman$ which ruby
/usr/bin/ruby
And .gemrc:
Johnny-Goodmans-MacBook-Pro:~ johnnygoodman$ cat .gemrc
---
:sources:
- http://rubygems.org/
- http://gems.github.com
:backtrace: false
:benchmark: false
:verbose: true
:update_sources: true
:bulk_threshold: 1000
Here's my gemlist:
Johnny-Goodmans-MacBook-Pro:~ johnnygoodman$ gem list
*** LOCAL GEMS ***
actionmailer (2.3.8, 2.3.5, 2.2.2, 1.3.6)
actionpack (2.3.8, 2.3.5, 2.2.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.8, 2.3.5, 2.2.2, 1.15.6)
activeresource (2.3.8, 2.3.5, 2.2.2)
activesupport (2.3.8, 2.3.5, 2.2.2, 1.4.4)
acts_as_ferret (0.4.4, 0.4.3)
Ascii85 (1.0.0)
autotest (4.2.10, 4.2.9)
autotest-fsevent (0.2.2, 0.1.1)
autotest-growl (0.2.4, 0.2.0)
autotest-rails (4.1.0)
bigdecimal-segfault-fix (1.0.1)
capistrano (2.5.18, 2.5.11, 2.5.2)
cgi_multipart_eof_fix (2.5.0)
cheat (1.2.1)
chronic (0.2.3)
configuration (1.1.0)
daemons (1.0.10)
dnssd (1.3.1, 0.6.0)
fastthread (1.0.7, 1.0.1)
fcgi (0.8.8, 0.8.7)
ferret (0.11.6)
gem_plugin (0.2.3)
gemcutter (0.5.0, 0.4.1)
heroku (1.9.9, 1.8.5)
highline (1.5.2, 1.5.1, 1.5.0)
hoe (2.6.0, 2.5.0)
hpricot (0.8.2, 0.6.164)
json_pure (1.4.3, 1.2.3, 1.2.2)
launchy (0.3.5)
libxml-ruby (1.1.4, 1.1.3, 1.1.2)
mail (2.2.1)
mechanize (1.0.0, 0.9.3)
mime-types (1.16)
mongrel (1.1.5)
mysql (2.8.1)
needle (1.3.0)
net-scp (1.0.2, 1.0.1)
net-sftp (2.0.4, 2.0.1, 1.1.1)
net-ssh (2.0.22, 2.0.21, 2.0.17, 2.0.4, 1.1.4)
net-ssh-gateway (1.0.1, 1.0.0)
nokogiri (1.4.2, 1.4.1)
passenger (2.2.11, 2.2.9)
pdf-reader (0.8.5, 0.8.4, 0.8.3)
polyglot (0.3.1)
pony (1.0, 0.9, 0.6)
rack (1.1.0, 1.0.1)
rails (2.3.8, 2.3.5, 2.2.2, 1.2.6)
rake (0.8.7, 0.8.3)
RedCloth (4.2.3, 4.1.1)
rest-client (1.4.2, 1.3.1)
rspec (1.3.0)
rspec-rails (1.3.2)
ruby-gmail (0.2.1, 0.0.8)
ruby-openid (2.1.7, 2.1.2)
ruby-yadis (0.3.4)
rubyforge (2.0.4)
rubygems-update (1.3.7, 1.3.6, 1.3.5, 1.3.1)
rubynode (0.1.5)
scrapi (1.2.0)
shared-mime-info (0.1)
sqlite3-ruby (1.2.5, 1.2.4)
sys-uname (0.8.4)
termios (0.9.4)
tidy (1.1.2)
tmail (1.2.7.1)
treetop (1.4.5)
xmpp4r (0.5, 0.4)
ZenTest (4.3.1)
I've uninstalled mac ports and used hivelogic instructions to install a fresh ruby/rails version. However, notice that my which ruby doesn't match hivelogic's instructions until I run:
Johnny-Goodmans-MacBook-Pro:~ johnnygoodman$ . ~/.profile
Johnny-Goodmans-MacBook-Pro:~ johnnygoodman$ which ruby
/usr/local/bin/ruby
I think this is the problem but am not sure what to read to force the ruby path to always load to /usr/local/bin/ruby. It could also be a red herring as I simply don't know how the parts fit. As soon as sudo gem install doesn't work, I'm basically lost.
Note other gems do work:
Johnny-Goodmans-MacBook-Pro:~ johnnygoodman$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'mechanize'
=> true
Questions:
When sudo gem install doesn't allow you to create an object from the class, what are the next steps in sleuthing down the issue?
How do the parts of a gem fit together as applies to fixing these types of issues? I've read the FAQs and docs (http://docs.rubygems.org/read/book/3) but either missed it or was unable to pick out the relevant parts.
Looks like you have some misunderstanding how ruby loads files. There's an include path (check out the $: variable). When you require something, ruby will start at the first path in the array, and checks if the file is there. If it's, then it loads it, otherwise it moves on to the next directory in the include path.
When you require gmail, it looks like that it loads your own gmail.rb. Doing a require "gmail" in that file will find itself, instead of the gem's gmail.rb.
To fix it you should probably rename your gmail.rb to something else (my_gmail.rb, or anything, just make sure it doesn't match any system file).
(The require 'ruby-gmail' fails because the ruby-gmail gem doesn't contain such file. You should use simply require 'gmail', but before that rename your gmail.rb)
Your IRB output seems to be about as far as you needed to go:
>> require 'gmail'
NameError: uninitialized constant Gmail
from ./gmail.rb:6
When you require 'gmail' it's pulling in your local gmail.rb file - within which there's a reference to a Gmail class(?) which isn't defined.
It's unclear why you'd expect Gmail to be defined, though. Without seeing the code in gmail.rb, it's hard to say what's wrong.
I notice that in your gem list there isn't any gem called "gmail" or anything similar.
It's hard to tell, therefore, what you're trying to accomplish. Perhaps you're confusing gems with a basic library require, or are assuming that the Rails constant-lookup functionality is a Ruby feature.
Most useful would be if you could post the contents of gmail.rb.

Ruby Debug IDE error : ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:in `debug_load'

I hope someone can assist me. I have RubyMine 2.0.2 installed on Windows 7 32 bit computer. Since a week ago (I presume it must have been after I have update some gems) I cant seem to debug form the IDE. I am trying to debug a rake task which I could before. Running the rake task normally works perfect, just debug doesnt. Its not just limited to the rake, I cant debug any ruby files. I've tried installing older versions of debug-ide and debug-base but to no success. I've tried it with ruby 1.8.7 and 1.8.6 on different computers but nothing. Trying to search the web gave some information, which I've tried, but also no success. Im desperate to get this working. Below are the full error and my current settings:
Error:
C:\InstantRails\ruby\bin\ruby.exe -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) C:\InstantRails\ruby\bin/rdebug-ide --port 57167 -- C:/InstantRails/rails_apps/paperserve/lib/tasks/poll_snmp.rake
Fast Debugger (ruby-debug-ide 0.4.9) listens on :57167
C:/InstantRails/rails_apps/paperserve/lib/tasks/poll_snmp.rake:5
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug ide.rb:109:in `debug_load'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug ide.rb:109:in `debug_program'
C:/InstantRails/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/bin/rdebug-ide:87
C:\InstantRails\ruby\bin/rdebug-ide:19:in `load'
C:\InstantRails\ruby\bin/rdebug-ide:19
-e:1:in `load'
-e:1
Uncaught exception: undefined method `namespace' for main:Object
Process finished with exit code 1
Code snippet (It fails at the start of namespace. If I remove this, it fails on the next line, etc, etc)
#This script should run every 15 minutes
require 'snmp'
require 'yaml'
namespace :cdeweb do
RubyGems Environment:
RUBYGEMS VERSION: 1.3.7 RUBY VERSION:
1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] INSTALLATION
DIRECTORY:
C:/InstantRails/ruby/lib/ruby/gems/1.8
RUBY EXECUTABLE:
C:/InstantRails/ruby/bin/ruby.exe
EXECUTABLE DIRECTORY:
C:/InstantRails/ruby/bin RUBYGEMS
PLATFORMS:
ruby
x86-mswin32-60
GEM PATHS:
C:/InstantRails/ruby/lib/ruby/gems/1.8
C:/Users/Paul.LPFSYSTEMS/.gem/ruby/1.8
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:benchmark => false
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
http://rubygems.org/
* LOCAL GEMS *
actionmailer (2.3.5, 2.0.2)
actionpack (2.3.5, 2.0.2)
activerecord (2.3.5, 2.0.2)
activeresource (2.3.5, 2.0.2)
activesupport (2.3.5, 2.0.2)
capistrano (2.5.18, 2.1.0)
cgi_multipart_eof_fix (2.5.0)
cmdparse (2.0.2) columnize (0.3.1)
fxri (0.3.7, 0.3.6) fxruby (1.6.12 mswin32)
gem_plugin (0.2.3)
highline(1.5.2, 1.4.0)
hpricot (0.8.2 x86-mswin32, 0.6 mswin32)
inaction_mailer (0.6)
json (1.4.2 x86-mswin32)
json_pure (1.4.2)
linecache (0.43 mswin32)
log4r (1.1.7, 1.0.5)
mongrel (1.1.5 x86-mswin32-60, 1.1.2 mswin32)
mysql(2.8.1 x86-mswin32, 2.7.3 mswin32)
needle (1.3.0)
net-scp (1.0.2)
net-sftp (2.0.4, 1.1.0)
net-ssh (2.0.22, 1.1.2)
net-ssh-gateway (1.0.1)
rack (1.0.1)
rails (2.3.5, 2.0.2)
rake (0.8.7, 0.8.1, 0.8.0, 0.7.3)
ruby-debug-base (0.10.3 mswin32)
ruby-debug-ide (0.4.9)
ruby-net-ldap (0.0.4)
rubygems-update (1.3.7, 1.3.6, 1.0.1)
snmp (1.0.2)
sources (0.0.1)
sqlite3-ruby (1.2.5 x86-mswin32, 1.2.1 mswin32)
win32-api (1.4.6 x86-mswin32-60, 1.0.4 mswin32)
win32-clipboard (0.5.2, 0.4.3)
win32-dir (0.3.6, 0.3.2)
win32-eventlog (0.5.2, 0.4.6)
win32-file (0.6.3, 0.5.4)
win32-file-stat (1.3.4, 1.2.7)
win32-process (0.6.2, 0.5.3)
win32-sapi (0.1.5, 0.1.4)
win32-sound (0.4.2, 0.4.1)
windows-api (0.4.0, 0.2.0)
at least ruby-mine 2.0.1 does not work with the latest ruby-debug-ide (0.4.9)
see http://pivotallabs.com/users/david/blog/articles/1167-make-the-rubymine-2-0-1-debugger-work-for-you-

Resources