Error "Is not a module"?

Hi im working with the Twitter gem, suddenly i get this error:

Twitter is not a module

The problem is you're trying to use Twitter as a module and it is not a module?
Please post the code where you're getting the error so we can help
you, otherwise is pretty impossible.


I try to use it like this:

def twitter_search
     @twitter_search ='#rails')

OK, I haven't used the Twitter gem, so I don't know the right syntax,
but you're certainly using it as a module.
Are you sure that's the right way to use it?
If it is, have you required the file where Twitter is defined?

I don't know if im using it the right way, i can't find any examples.
The DOC for the GEM is here:
And the GEM at github:

There are examples listed on the page you listed above. There's even a
link to a sample rails application on github, there.
Twitter seems to be a module, you should require the file somewhere.
Take a look at the sample application and see where it is required.

I know and have looked at it, but i still can't see how to use it!
The example shows the oAuth feature - but I just want to use the
search functions.

One vague stab in the dark: do you define a class of your own called
Twitter ?


Is i did :O( BIG MISTAKE!

But still what is the right way to use a gem like this?

Is it really the right way to call the search method?

def twitter_search
     @twitter_search ='#rails')

Dosen't anybody know how to use the GEM?


Dosen't anybody know how to use the GEM?

what about the 4 examples on the gem's website (which you linked to
earlier) ?


Hi Fred,
I know it's there but i dont now how to use it!
Should I put it in a model method and use it like this:

def twitter_search
     @twitter_search ='#rails')

Should I put it in the Application controller and call a before filter
in my other controllers, where i want to use the method?

Please let me know if you know how to use it...

That's not how to use the gem. That's your application's design.
The use of the gem API is just like the examples show. Where you use
it depends on your application design and there's no one valid rule
about that.
My guess is you will be using it mostly on controllers, but it's
totally up to you!