Twitter Authentication Error


I am developing a Ruby on Rails application for twitter users and I am using mongo for database I followed this post

It worked fine when I used default database (Sqlit3) but with mongodb at the end it is showing this error and I didnt find any answer so far

Please help…

Twitter::Error::Unauthorized in TwitterController#twitter_profile

Not authorized.

Rails.root: /Users/rekha/rails_projects/Behavior_app

Application Trace | Framework Trace | Full Trace

app/controllers/twitter_controller.rb:51:in `twitter_profile'