1. 错误:Faraday::Error::ConnectionFailed
SSL_connect returned=1 errno=0 state=SSLv3 read servercertificate B:
Certificate verify faild
解决:在d:\rails目录下建立文件win_fetch_cacerts.rb 将网页中的信息拷贝到文件中https://raw.github.com/gist/867550/win_fetch_cacerts.rb。在c:\RailsInstaller目录下建立文件cacert.pem。在命令中执行set SSL_CERT_FILE=C:\RailsInstaller\cacert.pem。执行ruby “%d:\rails\win_fetch_cacerts.rb%” 。配置环境变量:变量名:SSL_CERT_FILE 变量值:C:\RailsInstaller\cacert.pem
2. 错误:Can’tmass-assign protected attributes: authentications_attributes
解决:增加authentications_attributes的说明 attr_accessible : authentications_attributes
3. 错误:Can’tmass-assign protected attributes: created_at,updated_at
解决:def from_auth(auth)
Authentication.find_by_provider_and_uid(auth[:provider],
auth[:uid]).try(:admin)||
create!(
:nickname => auth[:info][:nickname],
:email => auth[:info][:email],
:authentications_attributes => [
Authentication.new(:provider =>auth[:provider],
:uid =>auth[:uid]
).attributes
]
)
End 改为
deffrom_auth(auth)
authentication =Authentication.find_by_provider_and_uid(auth[:provider],
auth[:uid]).try(:admin)
unless authentication
admin = create!(
:nickname =>auth[:info][:nickname],
:email => auth[:info][:email])
admin.authentications.build(:provider=> auth[:provider])
end
end
4. 错误:Validationfailed: Email can't be blank 公开的邮箱一定要填