This project is archived and is in readonly mode.

#2455 ✓stale
Jeff Williams

Update for sybase_adapter

Reported by Jeff Williams | April 8th, 2009 @ 09:44 AM | in 3.x

The sybase adapter is wrapped in a begin and rescue pair which means that errors in loading the required sybsql library are silent. For example, my sybsql library require fails with the following:

/usr/local/lib/site_ruby/1.8/i386-linux/sybct.so: /usr/local/sybase-11.0.3.3/lib/libsybtcl.so: undefined symbol: bsd_tcp - /usr/local/lib/site_ruby/1.8/i386-linux/sybct.so (LoadError)

which is a separate issue. However, having that error suppressed in the adapter means I got the following rails error:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:80:in establish_connection': database configuration specifies nonexistent sybase adapter (ActiveRecord::AdapterNotFound)

which is just plain confusing. Removing the begin/rescue give the error message:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:74:in establish_connection': Please install the sybase adapter:gem install activerecord-sybase-adapter(/usr/local/sybase-11.0.3.3/lib/libsybtcl.so: undefined symbol: bsd_tcp - /usr/local/lib/site_ruby/1.8/ i386-linux/sybct.so) (RuntimeError)

which gives an unhelpful tip about the gem, but at least prints the real error.

I've attached a patch for this, but it is a pretty straight forward change.

Jeff

Comments and changes to this ticket

  • windock

    windock May 13th, 2009 @ 08:29 PM

    this will make sybase adapter more similar to "mainstream" mysql, sqlite
    +1

  • jrochkind

    jrochkind October 14th, 2009 @ 03:56 PM

    1. I hope someone is watching tickets related to the sybase adapter? Unpatched, makes it very confusing to get the adapter working.

    However, with this patch, I'm still getting a very confusing error:

    RuntimeError: Please install the sybase adapter: gem install activerecord-sybase-adapter (no such file to load -- active_record/connection_adapters/sybase_adapter)

        from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:76:in `establish_connection'
    

    Even though I do have the gem installed. I guess this is still masking the actual problem with client libraries being gone? I wonder if AR itself masks it, and the sybase adapter needs to be patched in a different way to actually report the exception somehow instead of just raising it up to AR to catch?

  • jrochkind

    jrochkind October 14th, 2009 @ 04:00 PM

    I think the problem may be that this adapter doesn't work with Rails 2 at all?

  • windock

    windock October 15th, 2009 @ 07:36 PM

    Actually, it works with Rails 2. But only with older versions, like 2.1 or so (stopped after big refactoring of AR drivers).
    And yes, installing from gem is probably broken also, so I've ended hacking that in strange ways.

    Sorry, cannot help a lot, since our server with Sybase has been luckily and accidentally erased. Huh.

  • Jeremy Kemper

    Jeremy Kemper May 4th, 2010 @ 06:48 PM

    • Milestone changed from 2.x to 3.x
  • Matt

    Matt November 30th, 2010 @ 05:09 PM

    • Tag set to sybase rails3 active-record
    • Importance changed from “” to “”

    Any thoughts on getting the sybase adapter working with rails3 and arel?

  • rails

    rails March 1st, 2011 @ 12:00 AM

    • State changed from “new” to “open”

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

  • rails

    rails March 1st, 2011 @ 12:00 AM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages