Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Dan Rathbun
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 17:34
I wrote:
<<
.. or in irb you might try
puts $:.join("\n")
>>

Here's another neat trick.
If you have a custom setup ruby that runs, and loads tools, macros, whatever ... helpers.

you can put in it a singleton method just for the $LOAD_PATH ($:) to list it whenever you want.

def $:.list
puts self.join("\n")
end

Then you can type either of these:
$:.list
$LOAD_PATH.list

and you'll send a listing to STDOUT.

By: Dan Rathbun
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 17:21
Aaron wrote:
<<
irb(main):004:1> $:.join ("\n")
>>

Try not to put space char between method names and their parameter list; strange errors can result.

The newline argument for Array.join is the string separator to use when concatenating the Array's elements (which are converted to String if they aren't already a String.) So instead of getting on big long String (the defualt separator is nil,) you get a list with each element on a new line.

irb might not output the result, like the standard console.

.. or in irb you might try
puts $:.join("\n")

By: Aaron Drever
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 17:07
Works Great!

I am using the default Ruby command line shell, then type irb. I've added a SET RUBYOPT=rubygems to the setrbvars.bat in the bin directory of my ruby install.

irb(main):001:0> require 'win32/eventlog'
=> true

Presto! Thanks a bunch!

By: Daniel Berger
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 17:04
require 'rubygems' first. I'm guessing you don't have RUBYOPT set.

If you want to have rubygems loaded automatically, put RUBYOPT=rubygems in your environment variables.

Regards,

Dan

By: Aaron Drever
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 17:02
Interesting.

irb(main):004:1> $:.join ("\n")
irb(main):005:1>

By: Dan Rathbun
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 16:58
First lets see the contents of your $LOAD_PATH ($:) Array.

At the Console, type
$:.join("\n") [ENTER key]

Cut and paste the list into the forum.

By: Aaron Drever
RE: no such file to load -- win32/eventlog [ reply ]  
2010-02-23 16:56
I had a typo in the above thread.

irb(main):001:0> require 'win32/eventlog'
LoadError: no such file to load -- win32/eventlog
from (irb):1:in `require'
from (irb):1
irb(main):002:0>

Just to prove that when I actually type it in correctly it still happens.

By: Aaron Drever
no such file to load -- win32/eventlog [ reply ]  
2010-02-23 16:41
Hello,

I'm trying to use Win32/EventLog and it seems that it's not working when I try to require 'win32/eventlog'. I have updated my system and my current versions are as follows:
gems 1.3.6
win32-eventlog 0.5.2
I've ensured the prerequisites have been met.

When I use an interactive shell so that I can play as I learn I get the message:
irb(main):001:0> require 'win32/evenlog'
LoadError: no such file to load -- win32/evenlog
from (irb):1:in `require'
from (irb):1

Any ideas?