Nonexistent sybase adapter

From EggeWiki
Jump to navigation Jump to search

Here's the error:

$ ruby script/generate controller Search
/u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:200:in `establish_connection': database configuration specifies nonexistent sybase adapter (ActiveRecord::AdapterNotFound)
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:192:in `establish_connection'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:185:in `establish_connection'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb:182:in `initialize_database'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb:84:in `process'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/initializer.rb:42:in `run'
        from ./script/../config/../config/environment.rb:13
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/generate.rb:1
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
        from /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in `require'
        from script/generate:3

Seems that I need to tell Ruby where to find my Sybase libs -I ../sybct-ruby-0.2.8:

$ ruby -I ../sybct-ruby-0.2.8 script/generate controller Search
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/search
      exists  test/functional/
      create  app/controllers/search_controller.rb
      create  test/functional/search_controller_test.rb
      create  app/helpers/search_helper.rb

The better fix is to copy the files as per the README in sybct-ruby-0.2.8:

cp sybct.rb sybsql.rb /u/eggebr/pkgs/sunos-5.10-i86pc/lib/ruby/site_ruby/1.8/