Error "Is not a module"?

View: New views
13 Messages — Rating Filter:   Alert me  

Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Twitter is not a module

------------------------------


/Users/KAN/.gem/ruby/1.8/gems/twitter-0.7.0/lib/twitter/search.rb:1
vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in
`load_without_new_constant_marking'
vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in
`load_file'
vendor/rails/activesupport/lib/active_support/dependencies.rb:507:in
`new_constants_in'
vendor/rails/activesupport/lib/active_support/dependencies.rb:367:in
`load_file'
vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in
`require_or_load'
vendor/rails/activesupport/lib/active_support/dependencies.rb:413:in
`load_missing_constant'
vendor/rails/activesupport/lib/active_support/dependencies.rb:93:in
`const_missing'
app/controllers/application.rb:49:in `twitter_search'


What the problem? What does the error mean?

Thamks... :O)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by Bugzilla from leonardomateo@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, Nov 3, 2009 at 1:50 PM, andkjaer <andkjaer.net@...> wrote:

>
> Hi im working with the Twitter gem, suddenly i get this error:
>
> Twitter is not a module
>
> ------------------------------
>
>
> /Users/KAN/.gem/ruby/1.8/gems/twitter-0.7.0/lib/twitter/search.rb:1
> vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in
> `load_without_new_constant_marking'
> vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in
> `load_file'
> vendor/rails/activesupport/lib/active_support/dependencies.rb:507:in
> `new_constants_in'
> vendor/rails/activesupport/lib/active_support/dependencies.rb:367:in
> `load_file'
> vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in
> `require_or_load'
> vendor/rails/activesupport/lib/active_support/dependencies.rb:413:in
> `load_missing_constant'
> vendor/rails/activesupport/lib/active_support/dependencies.rb:93:in
> `const_missing'
> app/controllers/application.rb:49:in `twitter_search'
>
>
> What the problem? What does the error mean?
>
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.

Cheers.

--
Leonardo Mateo.
There's no place like ~

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I try to use it like this:

def twitter_search
     @twitter_search = Twitter::Search.new('#rails')
end

On 3 Nov., 14:29, Leonardo Mateo <leonardoma...@...> wrote:

> On Tue, Nov 3, 2009 at 1:50 PM, andkjaer <andkjaer....@...> wrote:
>
> > Hi im working with the Twitter gem, suddenly i get this error:
>
> > Twitter is not a module
>
> > ------------------------------
>
> > /Users/KAN/.gem/ruby/1.8/gems/twitter-0.7.0/lib/twitter/search.rb:1
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in
> > `load_without_new_constant_marking'
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:368:in
> > `load_file'
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:507:in
> > `new_constants_in'
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:367:in
> > `load_file'
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in
> > `require_or_load'
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:413:in
> > `load_missing_constant'
> > vendor/rails/activesupport/lib/active_support/dependencies.rb:93:in
> > `const_missing'
> > app/controllers/application.rb:49:in `twitter_search'
>
> > What the problem? What does the error mean?
>
> 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.
>
> Cheers.
>
> --
> Leonardo Mateo.
> There's no place like ~
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by Bugzilla from leonardomateo@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, Nov 3, 2009 at 2:31 PM, andkjaer <andkjaer.net@...> wrote:
>
> I try to use it like this:
>
> def twitter_search
>     @twitter_search = Twitter::Search.new('#rails')
> end
>
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?



--
Leonardo Mateo.
There's no place like ~

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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



On 3 Nov., 15:56, Leonardo Mateo <leonardoma...@...> wrote:

> On Tue, Nov 3, 2009 at 2:31 PM, andkjaer <andkjaer....@...> wrote:
>
> > I try to use it like this:
>
> > def twitter_search
> >     @twitter_search = Twitter::Search.new('#rails')
> > end
>
> 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?
>
> --
> Leonardo Mateo.
> There's no place like ~
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by Bugzilla from leonardomateo@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, Nov 3, 2009 at 4:09 PM, andkjaer <andkjaer.net@...> wrote:
>
> I don't know if im using it the right way, i can't find any examples.
> The DOC for the GEM is here: http://twitter.rubyforge.org/
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.

--
Leonardo Mateo.
There's no place like ~

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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.

On 3 Nov., 16:21, Leonardo Mateo <leonardoma...@...> wrote:

> On Tue, Nov 3, 2009 at 4:09 PM, andkjaer <andkjaer....@...> wrote:
>
> > I don't know if im using it the right way, i can't find any examples.
> > The DOC for the GEM is here:http://twitter.rubyforge.org/
>
> 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.
>
> --
> Leonardo Mateo.
> There's no place like ~
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by Frederick Cheung-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Nov 3, 12:50 pm, andkjaer <andkjaer....@...> wrote:
> Hi im working with the Twitter gem, suddenly i get this error:
>
> Twitter is not a module
>

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

Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 = Twitter::Search.new('#rails')
end


On 3 Nov., 18:33, Frederick Cheung <frederick.che...@...> wrote:

> On Nov 3, 12:50 pm, andkjaer <andkjaer....@...> wrote:
>
> > Hi im working with the Twitter gem, suddenly i get this error:
>
> > Twitter is not a module
>
> One vague stab in the dark: do you define a class of your own called
> Twitter ?
>
> Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dosen't anybody know how to use the GEM?

Thanks...

On 3 Nov., 19:08, andkjaer <andkjaer....@...> wrote:

> 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 = Twitter::Search.new('#rails')
> end
>
> On 3 Nov., 18:33, Frederick Cheung <frederick.che...@...> wrote:
>
> > On Nov 3, 12:50 pm,andkjaer<andkjaer....@...> wrote:
>
> > > Hi im working with the Twitter gem, suddenly i get this error:
>
> > > Twitter is not a module
>
> > One vague stab in the dark: do you define a class of your own called
> > Twitter ?
>
> > Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by Frederick Cheung-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message




On Nov 4, 7:05 am, andkjaer <andkjaer....@...> wrote:
> Dosen't anybody know how to use the GEM?
>
what about the 4 examples on the gem's website (which you linked to
earlier) ?

Fred

> Thanks...
>
> On 3 Nov., 19:08, andkjaer <andkjaer....@...> wrote:
>
>
>
> > 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 = Twitter::Search.new('#rails')
> > end
>
> > On 3 Nov., 18:33, Frederick Cheung <frederick.che...@...> wrote:
>
> > > On Nov 3, 12:50 pm,andkjaer<andkjaer....@...> wrote:
>
> > > > Hi im working with the Twitter gem, suddenly i get this error:
>
> > > > Twitter is not a module
>
> > > One vague stab in the dark: do you define a class of your own called
> > > Twitter ?
>
> > > Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by andkjaer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 = Twitter::Search.new('#rails')
end

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...


On 4 Nov., 10:33, Frederick Cheung <frederick.che...@...> wrote:

> On Nov 4, 7:05 am,andkjaer<andkjaer....@...> wrote:> Dosen't anybody know how to use the GEM?
>
> what about the 4 examples on the gem's website (which you linked to
> earlier) ?
>
> Fred
>
> > Thanks...
>
> > On 3 Nov., 19:08,andkjaer<andkjaer....@...> wrote:
>
> > > 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 = Twitter::Search.new('#rails')
> > > end
>
> > > On 3 Nov., 18:33, Frederick Cheung <frederick.che...@...> wrote:
>
> > > > On Nov 3, 12:50 pm,andkjaer<andkjaer....@...> wrote:
>
> > > > > Hi im working with the Twitter gem, suddenly i get this error:
>
> > > > > Twitter is not a module
>
> > > > One vague stab in the dark: do you define a class of your own called
> > > > Twitter ?
>
> > > > Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Error "Is not a module"?

by Bugzilla from leonardomateo@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Wed, Nov 4, 2009 at 10:57 AM, andkjaer <andkjaer.net@...> wrote:

>
> 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 = Twitter::Search.new('#rails')
> end
>
> 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!


--
Leonardo Mateo.
There's no place like ~

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---