views:

42

answers:

1

I was reading the book Ruby Cookbook by O'Reilly, and it has a section on RubyTorrent

But if I do the following on Win 7:

> gem install rubytorrent
> irb
irb(main):001:0> require 'rubytorrent'
LoadError: no such file to load -- rubytorrent
        from (irb):6:in `require'
        from (irb):6

I looked and found that C:\Ruby\lib\ruby\gems\1.8\gems\rubytorrent-0.3 does exist and gem list also shows the rubytorrent gem... tried in Ubuntu and it is the same thing. Does any one knows in this case, how to proceed?

+3  A: 

You spelled rubytorrent wrong :)

You first need to require rubygems.

require 'rubygems'
require 'rubytorrent'

And then follow the documentation on RubyTorrent

Martin Maciaszek
i tried on Ubuntu as well, couldn't have spelled it wrong the second time... anyway... i corrected the typo up above
動靜能量
Sorry for the confusion. I pressed submit accidently before I finished my post. So Jian Lin probably saw only the first line.
Martin Maciaszek
yeah, strange, none of the book or the docs on rubytorrent says rubygems need to be included. i am asking when it should be included on this question: http://stackoverflow.com/questions/3182818/when-do-we-need-to-require-rubygems
動靜能量