May 15
Sybase DB Adapter
Update: This adapter only works with the enterprise edition of Sybase (i.e. Sybase ASE) not with SQLAnywhere (Sybase ASA)
One of my Rails projects require me to connect to a Sybase ASA database, I quickly figured out that I needed to install the sybase adapter as in Rails 2.0.2 these and some of the other databases have been pulled out of Rails core. According to the information in this article you can achieve this by using this command:
gem install activerecord-sybase-adapter
When I tried this I got the following error:
ERROR: could not find activerecord-database-adapter locally or in a repository
The only way I got it to work was to use the -s option ("Use URL as the remote source for gems"), i.e.
gem install activerecord-sybase-adapter -s http://gems.rubyonrails.org


May 19th, 2008 at 1:13 pm
[…] Sybase DB Adapter […]
December 9th, 2008 at 12:02 pm
Hi:
Can you teach me how to use sybase ASE12.5 with Rails?
March 7th, 2009 at 6:49 am
Thanks! Works great.
March 7th, 2009 at 8:50 am
Well, maybe not so great. I’m trying to use Sybase from Rails. Even after doing “gem install activerecord-sybase-adapter -s http://gems.rubyonrails.org” I get the following message when starting mongrel:
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — activerecord-sybase-adapter (MissingSourceFile)
Do I need to set some env vars? I’d appreciate any guidance. fwiw:
$ gem list
*** LOCAL GEMS ***
actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.3.1, 2.2.2)
activerecord-sybase-adapter (1.0.0.9250)
activeresource (2.2.2)
activesupport (2.3.1, 2.2.2)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.10)
fastthread (1.0.1)
gem_plugin (0.2.3)
mongrel (1.1.5)
rails (2.2.2)
rake (0.8.4)
August 1st, 2009 at 12:05 am
John : don’t load it. Create the connection, ActiveRecord will load the adapter by itself.
ActiveRecord::Base.establish_connection(
:adapter => “sybase”,
:database => “test”,
:host => “www.yourdbserver.com”,
:usrname => “kevin”,
:password => “test”)
August 22nd, 2009 at 10:29 am
Aldric:
When I do that, I still get the “nonexistent sybase adapter” error.
ActiveRecord::AdapterNotFound: database configuration specifies nonexistent sybase adapter
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:82:in `establish_connection’
from (irb):7
Same thing when I use rails with the equivalent in database.yml
September 1st, 2009 at 3:25 am
Justin:
“Update: This adapter only works with the enterprise edition of Sybase (i.e. Sybase ASE) not with SQLAnywhere (Sybase ASA)”
You do have this installed on your machine right?
I have been running into issues with this lately too. Try using “:adapter => sybaseanywhere” maybe?
I realized that what I was doing in irb was only creating an object, not .. connecting, and that the connection generated an error. Maybe it works with earlier version of Rails (> 2.0 and
September 8th, 2009 at 11:48 pm
Anybody know if we need to add specific DLLs to the Ruby installation to get this to work properly?
September 12th, 2009 at 2:08 am
Check this out:
http://trevoke.net/blog/2009/09/11/connecting-to-sybase-with-rails-on-windows-xp/
November 18th, 2009 at 10:09 pm
You may need to install sybase-ctlib for activerecord-sybase-adapter to work
sources: http://raa.ruby-lang.org/project/sybase-ctlib
windows binaries: http://flesaker.no/software/sybase-ctlib/
It’s a pity that such sophisticated and widespread in enterprise db is so poorly supported by ruby/rails