From: Brad Sherard Date: 2007-03-27T03:34:09+09:00 Subject: Re: importing GEM libraries .... newby questions Timothy Hunter wrote: > cugf_0956 wrote: >> Thanks a lot. >> [...] > You need to have RubyGems loaded before you require any libraries that > were installed using RubyGems. You can do this: > > export RUBYOPT=rubygems > > or in every script that requires a gem, require 'rubygems' before > requiring any gem. I have the exact problem cugf described right down to using the same gem (selenium). I tried your first suggestion but that returned with a compile time error. I've wasted a day digging through google links without any luck but maybe I was searching for the wrong things. Here is what I have: C:\Documents and Settings\user>gem contents selenium c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/bin/selenium c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/button.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/directory_listing_page.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/link.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/locator.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/openqa c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/selenium_server.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/server_manager.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/text_field.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/version c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/openqa/README c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/openqa/selenium-server.jar.txt c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/lib/selenium/openqa/selenium.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/spec/selenium c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/spec/selenium/download_page.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/spec/selenium/home_page.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/spec/selenium/menu.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/spec/selenium/tc_basic_operation.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/spec/selenium/tc_selenium_server.rb c:/ruby/lib/ruby/gems/1.8/gems/Selenium-1.0.1/README And the (very unhelpful) example selenium provides has the following requires: require 'spec' $:.unshift File.join(File.dirname(__FILE__), '..') require 'lib/selenium' I have no idea how to figure out what to require so I have to assume the example is exhaustive and correct. However, just using the lines above errors out on the first require with the reason: no such file to load. If it is a problem of not having rubygems loaded, would someone mind very much elaborating a bit on the 'export RUBYOPT=rubygems' stuff? Also, is there a way to discern what values should be specified in the require lines for a given installed gem? Is there a way to just require individual .rb files? In advance, thank you to anyone with information. Normally I wouldn't dare asking such simple questions but I cannot figure this out. -- Posted via http://www.ruby-forum.com/.