用于postgresql的cas config.yml

时间:2012-08-23 09:40:22

标签: postgresql cas rubycas

当我使用postgresql配置CAS时,服务器无法启动

database:
  adapter: postgresql
  database: MyDB_development
  username: xxxxxxxxx
  password: xxxxxxxxx
  host: localhost

authenticator:
  class: CASServer::Authenticators::SQL
  database:
    adapter: postgresql
    database: MyDB_development
    username: xxxxxxxxx
    password: xxxxxxxxx
    host: localhost
  user_table: users
  username_column: username
  password_column: password
我错过了什么吗?

更新

我正在使用ubuntu 12.04

我明白了:

>>> Redirecting RubyCAS-Server log to /var/log/casserver.log

>>> Running migrations to make sure your database schema is up to date...
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- pg (LoadError)
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /var/lib/gems/1.8/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:242:in `require'
        from /var/lib/gems/1.8/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /var/lib/gems/1.8/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:597:in `new_constants_in'
        from /var/lib/gems/1.8/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:225:in `load_dependency'
        from /var/lib/gems/1.8/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:242:in `require'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/postgresql_adapter.rb:9:in `postgresql_connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `send'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `new_connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:237:in `checkout_new_connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:191:in `checkout'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `loop'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:187:in `checkout'
        from /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:186:in `checkout'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:94:in `connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_pool.rb:317:in `retrieve_connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:97:in `retrieve_connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:488:in `initialize'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:435:in `new'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:435:in `up'
        from /var/lib/gems/1.8/gems/activerecord-3.0.17/lib/active_record/migration.rb:417:in `migrate'
        from /var/lib/gems/1.8/gems/rubycas-server-1.1.1/bin/../lib/casserver/server.rb:276:in `init_database!'
        from /var/lib/gems/1.8/gems/rubycas-server-1.1.1/bin/../lib/casserver/server.rb:287
        from /var/lib/gems/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:1328:in `configure'
        from /var/lib/gems/1.8/gems/rubycas-server-1.1.1/bin/../lib/casserver/server.rb:284
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /var/lib/gems/1.8/gems/rubycas-server-1.1.1/bin/../lib/casserver.rb:10
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
        from /var/lib/gems/1.8/gems/rubycas-server-1.1.1/bin/rubycas-server:28
        from /usr/local/bin/rubycas-server:19:in `load'
        from /usr/local/bin/rubycas-server:19

1 个答案:

答案 0 :(得分:1)

从错误消息中,您似乎忘记安装pg gem,因此尝试访问数据库连接器接口时启动失败。