Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No such file or directory tiny_tds.so (CentOS) #399

Open
Insood opened this issue Dec 11, 2017 · 5 comments
Open

No such file or directory tiny_tds.so (CentOS) #399

Insood opened this issue Dec 11, 2017 · 5 comments

Comments

@Insood
Copy link

Insood commented Dec 11, 2017

Before submitting an issue please check these first!

  • On Windows? If so, do you need devkit for your ruby install? On CentOS
  • Using Ubuntu? If so, you may have forgotten to install FreeTDS first. It's installed
  • Are you using FreeTDS 0.95.80 or later? Check $ tsql -C to find out. Running v1.00.21
  • If not, please update then uninstall the TinyTDS gem and re-install it. It is
  • Have you made sure to enable SQL Server authentication? Not there yet
  • Doing work with threads and the raw client? Use the ConnectionPool gem? Not there yet

If none of these help. Please fill out the following:

Environment

Operating System
centos-release-7-4.1708.el7.centos.x86_64 (Linux 113aad881d1e 3.10.0-693.5.2.el7.x86_64 #1 SMP Fri Oct 20 20:32:50 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux)

TinyTDS Version and Information

version 2.1.0, built natively

FreeTDS Version
Version: freetds v1.00.21
freetds.conf directory: /usr/local/etc
MS db-lib source compatibility: no
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 7.3
iODBC: no
unixodbc: no
SSPI "trusted" logins: no
Kerberos: no
OpenSSL: yes
GnuTLS: no
MARS: no

Description

Hello, I'm trying to upgrade my rails app to the latest version of rails, ruby, and to have it run on the latest version of CentOS. I've setup a docker image to handle setting up the environment, etc, and one of the steps that's performed is to pull in FreeTDS and compile it so that later the tiny_tds gem has something to work with.

Dockerfiles here

I can do bundle install just fine (I've provided a small snippet in the gist of the tiny_tds building just fine natively), but when I go to run anything (when in the interactive Docker shell or when just running the docker container), I get the following error:

rirb(main):001:0> require 'tiny_tds'
LoadError: libsybdb.so.5: cannot open shared object file: No such file or directory - /opt/rh/rh-ruby24/root/usr/local/lib64/gems/ruby/tiny_tds-2.1.0/tiny_tds/tiny_tds.so
	from /opt/rh/rh-ruby24/root/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/rh/rh-ruby24/root/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:59:in `require'
	from /opt/rh/rh-ruby24/root/usr/local/share/gems/gems/tiny_tds-2.1.0/lib/tiny_tds.rb:60:in `<top (required)>'
	from /opt/rh/rh-ruby24/root/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:135:in `require'
	from /opt/rh/rh-ruby24/root/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
	from /opt/rh/rh-ruby24/root/usr/local/share/ruby/site_ruby/rubygems/core_ext/kernel_require.rb:40:in `require'
	from (irb):1
	from /opt/rh/rh-ruby24/root/usr/bin/irb:11:in `<main>'
irb(main):002:0> 

Which is odd because there is a file /opt/rh/rh-ruby24/root/usr/local/lib64/gems/ruby/tiny_tds-2.1.0/tiny_tds/tiny_tds.so:

[root@113aad881d1e rails_test]# ls -l /opt/rh/rh-ruby24/root/usr/local/lib64/gems/ruby/tiny_tds-2.1.0/tiny_tds/           
total 108
-rwxr-xr-x. 1 root root 109680 Dec 11 23:02 tiny_tds.so
[root@113aad881d1e rails_test]# 

Here's the output of make & make install for freetds

@metaskills
Copy link
Member

Could it be similar to this issue? #396 (comment)

@Insood
Copy link
Author

Insood commented Dec 12, 2017

Hey - I think it's just an issue with the location of libsybdb.so.5

tiny_tds thinks that libsybdb.so.5 lives in /lib/

[root@113aad881d1e tiny_tds]# ldd tiny_tds.so 
	linux-vdso.so.1 =>  (0x00007ffe3a01e000)
	libruby.so.2.4 => /opt/rh/rh-ruby24/root/usr/lib64/libruby.so.2.4 (0x00007f3f38dec000)
	libsybdb.so.5 => /lib/libsybdb.so.5 (0x00007f3f38b7b000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3f3895f000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f3f3875b000)

After compiling freetds, it lives in two places:

[root@113aad881d1e tiny_tds]# find /. -name libsybdb.so.5
/./usr/local/lib/libsybdb.so.5
/./freetds-1.00.21/src/dblib/.libs/libsybdb.so.5

( user local is where it's configured to be installed - ./configure --prefix=/usr/local --with-tdsver=7.3 )

Weird that tiny_tds thinks that it's in /lib/

Since this is a docker file and it's a brand new install - what should I do? I don't want to do a symlink since that seems dirty.

@metaskills
Copy link
Member

Maybe something to do with the way you installed FreeTDS for CentOS?

@stevelake
Copy link

stevelake commented Dec 12, 2017 via email

@sevk
Copy link

sevk commented Apr 7, 2021

图片

E:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require': cannot load such file -- tiny_tds (LoadError) from E:/Ruby27/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:92:in require'
from t.rb:2:in `

'

ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [i386-mingw32]

tiny_tds (2.1.3 ruby x86-mingw32)

OS 名称: Microsoft® Windows Server® 2008 Enterprise
OS 版本: 6.0.6001 Service Pack 1 Build 6001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants