繁体   English   中英

语法错误,意外的'\\ n',期望=>

[英]syntax error, unexpected '\n', expecting =>

我在登录页面上实现了LinkedIn的OmniAuth,但出现此错误:

SyntaxError  
/app/models/user.rb:9: syntax error, unexpected '\n', expecting =>  

它正在查看的代码是这样的:

class User < ActiveRecord::Base  
  attr_accessor :email, :password, :password_confirmation  
  VALID_EMAIL_REGEX = /([\w+.]+)@[a-z0-9\-.]+\.[a-z]+/i   
  validates :email, presence: true,   
                    format: { with: VALID_EMAIL_REGEX },   
                    uniqueness: { case_sensitive: false }  
  validates :password, presence: true, length: { minimum: 6 }  
  validates :password_confirmation, presence: true  
  devise :rememberable, :omniauthable, :omniauth_providers => [:linkedin], :trackable
end

有什么建议吗?

尝试重新排序

devise :rememberable, :omniauthable, :trackable, :omniauth_providers => [:linkedin]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM