[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

errors with hawler gem on os x 10.5

Pauli Price

6/18/2008 2:58:00 AM

I wrote this little website spidering script using hawler (sudo gem
install --source http://spoofed.org/fil... hawler) and got it
working on windows xp pro. I had to comment out some signal handling in
the gem code, but other than that, using it was uneventful.

Fast forward a few months - my xp laptop died and I purchased a new
macbook pro. Now the script that ran on XP won't run on mac os. I
haven't edited the gem files, as there was no need to remove the signal
handling.

Running on os x 10.5, I get the following error:

Connection to http://www.some-d... failed! -- getaddrinfo:
nodename nor servname provided, or not known

Not knowing where to start, I decided to run the gem's included tests.
But this time I get a different error, the following:

$ ./test/ts_all.rb
/test/ts_all.rb: line 3: syntax error near unexpected token `('
/test/ts_all.rb: line 3: `$:.unshift File.join(File.dirname(__FILE__),
"..", "lib")'


The contents of this file are:

# $Id: ts_all.rb 4 2008-03-02 04:47:09Z warchild $

$:.unshift File.join( File.dirname(__FILE__), "..", "test")
require 'ts_hawlee'
require 'ts_hawler'
require 'ts_hawlerhelper'

I've tried running it standing in the test directory as well - with the
same results.

Any suggestions for either the original or the test error?

Thanks!

Pauli
--
Posted via http://www.ruby-....

3 Answers

Eric Hodel

6/18/2008 3:07:00 AM

0


On Jun 17, 2008, at 19:57 PM, Pauli Price wrote:

> I wrote this little website spidering script using hawler (sudo gem
> install --source http://spoofed.org/fil... hawler) and got it
> working on windows xp pro. I had to comment out some signal
> handling in
> the gem code, but other than that, using it was uneventful.
>
> Fast forward a few months - my xp laptop died and I purchased a new
> macbook pro. Now the script that ran on XP won't run on mac os. I
> haven't edited the gem files, as there was no need to remove the
> signal
> handling.
>
> Running on os x 10.5, I get the following error:
>
> Connection to http://www.some-d... failed! -- getaddrinfo:
> nodename nor servname provided, or not known
>
> Not knowing where to start, I decided to run the gem's included tests.
> But this time I get a different error, the following:
>
> $ ./test/ts_all.rb
> ./test/ts_all.rb: line 3: syntax error near unexpected token `('
> ./test/ts_all.rb: line 3: `$:.unshift
> File.join(File.dirname(__FILE__),
> "..", "lib")'
>
>
> The contents of this file are:
>
> # $Id: ts_all.rb 4 2008-03-02 04:47:09Z warchild $
>
> $:.unshift File.join( File.dirname(__FILE__), "..", "test")


There is no shebang, so the file was run with sh.

Try ruby test/test_all.rb.

Pauli Price

6/18/2008 6:48:00 AM

0

As expected, that did the trick.

Of course, all tests passed.

In other languages I'd step it through a debugger next.

Any pointers on debugging ruby scripts -- links to tutorial articles
very welcome.

Pauli



Eric Hodel wrote:
> There is no shebang, so the file was run with sh.
>
> Try ruby test/test_all.rb.

--
Posted via http://www.ruby-....

Pauli Price

6/18/2008 1:43:00 PM

0

Of course, a search of the forum was in order and I found this:

http://brian.maybeyoureinsane.net/blog/2007/05/07/ruby-debug-basics-s...



Pauli Price wrote:
> [asking about debugging technique]
--
Posted via http://www.ruby-....