LoadError in Articles#index cannot load such file -- omniauth for twitter authentication in ruby on rails -
i trying twitter authentication blog. have implemented devise in application. following http://railscasts.com/episodes/235-devise-and-omniauth-revised
video. when completed steps mentioned in video , tried access application, getting cannot load such file -- omniauth
error. details of error message following.
extracted source (around line #12): 9: <div id="tabs"> 10: <ul id="tabs"> 11: <li><div style="color:#82b548;font-size: 0.9em;"> <%= time_tag(article.created_at.in_time_zone("asia/calcutta")) %> </div></li> 12: <li> <div style="color:#4895d1; font-size: 0.9em;"> <%= article.user.username if article.user %></div></li> 13: <% if !article.nil? %> 14: <li><div style="color:#ccd600; font-size: 0.9em;"> <%= article.comments.size %> comments </div></li> 15: <li><div style="color:#ccd600; font-size: 0.9em;"> <%= link_to article.tags.collect(&:name).join(" ") %> </div></li> rails.root: f:/kuta/billi application trace | framework trace | full trace app/models/user.rb:15:in `<class:user>' app/models/user.rb:1:in `<top (required)>' app/views/articles/index.html.erb:12:in `block in _app_views_articles_index_html_erb__265352894_31994844' app/views/articles/index.html.erb:6:in `each' app/views/articles/index.html.erb:6:in `_app_views_articles_index_html_erb__265352894_31994844'
models/user.rb
class user < activerecord::base attr_accessible :username, :email, :password, :password_confirmation, :remember_me attr_accessible :title, :body validates_confirmation_of :password validates_presence_of :password, :on => :create validates_presence_of :email, :on => :create validates_presence_of :username, :on => :create validates_uniqueness_of :email validates_uniqueness_of :username has_many :articles, :order => "created_at desc" has_many :comments # include default devise modules. others available are: # :token_authenticatable, # :lockable, :timeoutable , :omniauthable devise :database_authenticatable, :registerable, :omniauthable, :recoverable, :rememberable, :trackable, :validatable def self.from_omniauth(auth) where(auth.slice(:provider, :uid)).first_or_create |user| user.provider = auth.provider user.uid = auth.uid user.username = auth.info.nickname end end def self.new_with_session(params, session) if session["devise.user_attritubes"] new(session["devise.user_attributes"], without_protection: true) |user| user.attributes = params user.valid? end else super end end def password_required? super && provider.blank? end end
i think error lies in 12 line of code , regarding user. not know missing. let me know if need more code pasted.
Comments
Post a Comment