cas config.yml for postgresql

490 views Asked by At

when I configure CAS with postgresql, server doesn't start

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

am I missing something?

UPDATE

I'm using ubuntu 12.04

I get this:

>>> 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

There are 1 answers

0
Craig Ringer On BEST ANSWER

From the error message, it looks like you forgot to install the pg gem, so startup fails when it tries to access the DB connector interface.