SQLAnywhere Ruby Interface

53 views
Skip to first unread message

veejar

unread,
Aug 5, 2010, 3:55:47 AM8/5/10
to SQL Anywhere Web Development
I try to install SQLAnywhere Ruby Interface on Gentoo Linux 2010.
Ruby Version 1.8.6.

I have installed 'sqlanywhere gem'.

=====================
require 'sqlanywhere'

api = SQLAnywhere::
SQLAnywhereInterface.new()
initResult =
SQLAnywhere::API.sqlany_initialize_interface( api ).inspect
=======================

initResult is 0

I also have installed (compiled) sqlanywhere from sources (git clone
git://github.com/sqlanywhere/sqlanywhere.git)
initResult is also 0

Help please to find cause of problem.

Eric Farrar

unread,
Aug 5, 2010, 9:24:57 AM8/5/10
to SQL Anywhere Web Development
What version of SQL Anywhere are you running on your Gentoo machine?

- Eric

mikelb

unread,
Aug 5, 2010, 10:00:07 AM8/5/10
to SQL Anywhere Web Development
I had the same issue. It turned out that I wasn't sourcing the
sa_config.sh script early enough, such that the necessary libraries
weren't being found.

veejar

unread,
Aug 13, 2010, 7:36:26 AM8/13/10
to SQL Anywhere Web Development
I install SQL Anywhere 10.0.1.3415
LD_LIBRARY_PATH=/opt/sqlanywhere10/jre150/lib/i386/client:/opt/
sqlanywhere10/jre150/lib/i386:/opt/sqlanywhere10/jre150/lib/i386/
native_threads:/opt/sqlanywhere10/lib32

veejar

unread,
Aug 13, 2010, 7:42:29 AM8/13/10
to SQL Anywhere Web Development
I trye also such ruby-code:

require 'dbi'

options = {}
dbh = DBI.connect('DBI:SQLAnywhere:192.168.1.10', 'dba', 'dba',
options)

Error:
/usr/lib/ruby/gems/1.8/gems/dbd-sqlanywhere-0.1.2/lib/dbd/
SQLAnywhere.rb:59:in `initialize': Could not load SQLAnywhere DLL
(LoadError)
from /usr/lib/ruby/1.8/singleton.rb:94:in `new'
from /usr/lib/ruby/1.8/singleton.rb:94:in `instance'
from /usr/lib/ruby/gems/1.8/gems/dbd-sqlanywhere-0.1.2/lib/dbd/
sqlanywhere/driver.rb:63:in `connect'
from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi/handles/
driver.rb:33:in `connect'
from /usr/lib/ruby/gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:148:in
`connect'
from 2.rb:6



On 5 авг, 16:24, Eric Farrar <ianywhere.efar...@gmail.com> wrote:

Eric Farrar

unread,
Aug 13, 2010, 2:17:07 PM8/13/10
to SQL Anywhere Web Development
I think that you will need to update to a later version of SQL
Anywhere 10. The required libraries for interfacing with Ruby became
available in SQL Anywhere 10.0.1.3767. The version you are running
(10.0.1.3415 ) is several years old.

Let me know if you have any questions about updating.

Thanks,

- Eric
Reply all
Reply to author
Forward
0 new messages