# Trying to get Rails working with Sybase ASE

**URL:** <https://www.ruby-forum.com/t/trying-to-get-rails-working-with-sybase-ase/187734>\
**Category:** Rails\
**Created:** [April 28, 2010, 2:08pm UTC](https://www.ruby-forum.com/t/trying-to-get-rails-working-with-sybase-ase/187734 "2010-04-28T14:08:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rolf\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dec6dc/32.png) [@Rolf\_P](https://www.ruby-forum.com/u/Rolf_P)\
**Post date:** [April 28, 2010, 2:08pm UTC](https://www.ruby-forum.com/t/trying-to-get-rails-working-with-sybase-ase/187734/1 "2010-04-28T14:08:40Z")

</div>

Hi

I’m trying to use the activerecord-sybase-adapter to be able to use ASE  
with  
my rails applications.  
But, I am struggling…

I followed (most of) the steps on this informative page:  
[http://trevoke.net/blog/2009/09/11/connecting-to-sybase-with-rails-on-windows-xp/](http://trevoke.net/blog/2009/09/11/connecting-to-sybase-with-rails-on-windows-xp/)

Initially I had Rails 2.3.5 installed.  
I copied the “Ruby Sybase files” as instructed and the Sybase dll files  
as  
well, and I installed activerecord-sybase-adapter (1.0.0.9250).  
The Sybase environment I already have on my office computer, so it  
should be  
allright.  
I don’t have the mentioned JDBC\_HOME setting or the classpath setting,  
but  
I’m using Open Client, so should there be any need for the JDBC  
settings?

Ok, things looked promising, and I started creating a test rails app.

rails testapp

I then edited the database.yml to fit Sybase ASE  
development:  
adapter: sybase  
database: testdb  
username: username  
password: password  
host: sauron

The host, sauron, is defined in the sql.ini file.

Running rake db:create tells me that the database testdb already exists.  
(true)  
ruby script\generate scaffold person first\_name:string last\_name:string  
WORKS OK  
rake db:migrate --trace FAILS!  
(in C:/work/ror/testapp)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
\*\* Execute db:migrate  
rake aborted!  
undefined method `select_rows' for #<ActiveRecord::ConnectionAdapters::SybaseAdapter:0x97d8be8> c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:27:in `select\_values’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/migration.rb:416:in  
`get_all_versions' c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:532:in `migrated’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/migration.rb:441:in  
`current_version' c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:458:in `migrate’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:115:in  
`detect' c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:458:in `each’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/migration.rb:458:in  
`detect' c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:458:in `migrate’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active\_record/migration.rb:400:in  
`up' c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/migration.rb:383:in `migrate’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/tasks/databases.rake:116  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in  
`invoke_with_call_chain' c:/prg/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in  
`invoke_with_call_chain' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in  
`invoke_task' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top\_level’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top\_level’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in  
`standard_exception_handling' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top\_level’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard\_exception\_handling’  
c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' c:/prg/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 c:/prg/ruby/bin/rake:19:in `load’  
c:/prg/ruby/bin/rake:19

so… looks like something’s missing here. In mysql\_adapter.rb there is  
a  
select\_row function, but not in the sybase\_adapter.rb.

I tried downgrading Rails to 2.1.0 because I read somewhere that the  
activerecord-sybase-adapter perhaps was not working for the latest Rails  
releases, but got only a slightly different error message:  
rake aborted!  
select\_rows is an abstract method  
c:/prg/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active\_record/connection\_adapters/abstract/database\_statements.rb:34:in  
`select\_rows’  
…

Anyone has an idea?

Best regards,  
Rolf

---

<div class="post-metadata">

**Author:** ![Rolf\_P](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/dec6dc/32.png) [@Rolf\_P](https://www.ruby-forum.com/u/Rolf_P)\
**Post date:** [April 28, 2010, 7:44pm UTC](https://www.ruby-forum.com/t/trying-to-get-rails-working-with-sybase-ase/187734/2 "2010-04-28T19:44:46Z")

</div>

For anyone interested in this topic, see this thread:

[http://groups.google.com/group/ruby-on-rails-sybase-developers/browse\_thread/thread/1eca62c3578cdf34?hl=en](http://groups.google.com/group/ruby-on-rails-sybase-developers/browse_thread/thread/1eca62c3578cdf34?hl=en)

Best regards,  
Rolf
