【rubycas-server】遇到的一些问题记录

1.启动时遇到can't load sucn file activerecord-mysql2-adapter

明明都已经装好了,但是就是报这个错误。

后来调查发现,rubycas-server-1.1.2使用activerecord-3.0.20。

 而这个版本的activerecord总是试图从自己的目录里读取mysql2_adapter.rb文件,但是他自己又没有。

好像3.2.21版本的activerecord里就包含有该文件了。

于是单独安装activerecord-mysql2-adapter的gem,并把其中的"mysql2_adapter.rb"的文件拷贝到activerecord-3.0.20相应的目录下,就解决了。



2.尝试登陆验证时报错:

ActiveRecord::SubclassNotFound - The single-table inherita
nce mechanism failed to locate the subclass: 'User'. This error is raised becaus
e the column 'type' is reserved for storing the class in case of inheritance. Pl
ease rename this column if you didn't intend it to be used for storing the inher
itance class or overwrite CASServer::Authenticators::SQLEncrypted::CASUser_0.inh
eritance_column to use another column for that information.


user表里有一个type字段,这个字段名字是保留字所以就报错了。

解决方法:

配置文件中加上一个ignore_type_column: true

authenticator:
  class: CASServer::Authenticators::SQLEncrypted
  database:
    adapter: mysql2
    database: bitnami_redmine
    username: bitnami
    password: b600d8e46e
    port: 3308
    host: localhost
  user_table: users
  username_column: login
  encrypt_function: 'user.hashed_password == Digest::SHA1.hexdigest("#{user.salt}#{Digest::SHA1.hexdigest(@password)}")'
  ignore_type_column: true

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值