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

Please prepare tiny_tds gem for Ruby v3.0 on Windows #503

Closed
ecentell-CPF opened this issue Sep 3, 2021 · 13 comments
Closed

Please prepare tiny_tds gem for Ruby v3.0 on Windows #503

ecentell-CPF opened this issue Sep 3, 2021 · 13 comments

Comments

@ecentell-CPF
Copy link
Contributor

ecentell-CPF commented Sep 3, 2021

Windows 10 Pro 2004

ERROR: Error installing tiny_tds:

tiny_tds-2.1.5-x64-mingw32 requires ruby version < 2.8.dev, >= 2.4, which is
incompatible with the current version, ruby 3.0.2p107

This is using the pre-compiled Windows gem on Rubygems.org

Please advise. Thanks!

@ecentell-CPF
Copy link
Contributor Author

@aharpervc Since you were so helpful last time, any chance you can assist in getting the right resources to comment on this? Thanks!

@ecentell-CPF
Copy link
Contributor Author

Copying in anyone in the @ preview list (I apologize if you are copied and have no authority in this gem)...we rely on this gem and this is stopping our Ruby 3.0 upgrade. Is there any plans to upgrade compatibility? @metaskills @jeremyevans @ebryn @luislavena

lambacck added a commit to lambacck/tiny_tds that referenced this issue Oct 31, 2021
Add Ruby 3.0 to CI and cross compile list. This also drops any rubies
below 2.6 from CI and cross compile since they are now EOL. This is
based on the changes in rails-sqlserver#456 to add Ruby 2.7

Closes: rails-sqlserver#503
@ecentell-CPF
Copy link
Contributor Author

Devs that committed to this project...could anyone make any comments on this ticket or the proposed PR? @bvogelzang @aharpervc @wpolicarpo @larskanis

@ecentell-CPF
Copy link
Contributor Author

Monthly Check in @metaskills @coderjoe @bvogelzang @aharpervc thanks!

@aharpervc
Copy link
Contributor

It looks like @lambacck has started work on this over in #509. You could help this process along by investigating why that change has caused the CI job to fail, and the contributing your own commits/PR to fix it.

@ecentell-CPF
Copy link
Contributor Author

Since i have no working knowledge of AppVeyor I cannot contribute much to it. But looking at the log

error: '/var/cache/pacman/pkg/zstd-1.4.7-1-x86_64.pkg.tar.xz': invalid or corrupted package (PGP signature)
loading packages...
Command exited with code 1

It looks like the environment itself has issues. https://help.appveyor.com/discussions/problems/27815-build-failing-due-to-key-error and https://www.msys2.org/news/#2020-06-29-new-packagers

@Largo
Copy link
Contributor

Largo commented Apr 28, 2022

I figured it out thanks to stackoverflow posts, by looking at the freetds windows zipfile and the installed pacman package.

It's probably looking for the include folder headers at C:\Ruby31-x64\msys64\ucrt64\include
However it is at C:\Ruby31-x64\msys64\ucrt64\include\freetds
The .exe files interestingly are at C:\Ruby31-x64\msys64\ucrt64\bin and are found.

 gem install tiny_tds -- --with-freetds-include=C:\Ruby31-x64\msys64\ucrt64\include\freetds

I don't know how to fix that in the gem. I however confirmed that this workaround is working with Ruby+Devkit 3.1.2-1

How to make sure bundle install works:
bundle config build.tiny_tds --with-freetds-include=C:\Ruby31-x64\msys64\ucrt64\include\freetds

@om-orshee
Copy link

@Largo Not for me :(

$ gem install tiny_tds -- --with-freetds-include=C:\Ruby31-x64\msys64\ucrt64\include\freetds
Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-freetds
Building native extensions with: '--with-freetds-include=C:Ruby31-x64msys64ucrt64includefreetds'
This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/ext/tiny_tds

C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220526-4204-uuh2f.rb extconf.rb --with-freetds-include=C:Ruby31-x64msys64ucrt64includefreetds
looking for freetds headers in the following directories:

  • /opt/local/include
  • /opt/local/include/freetds
  • /usr/local/include
  • /usr/local/include/freetds
    looking for freetds library in the following directories:
  • /opt/local/lib
  • /opt/local/lib/freetds
  • /usr/local/lib
  • /usr/local/lib/freetds
    checking for sybfront.h... no
    checking for sybdb.h... no
    checking for tdsdbopen() in -lsybdb... yes
    checking for dbanydatecrack() in -lsybdb... yes
    Failed! Do you have FreeTDS 0.95.80 or higher installed?
    *** extconf.rb failed ***
    Could not create Makefile due to some reason, probably lack of necessary
    libraries and/or headers. Check the mkmf.log file for more details. You may
    need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
--help
--with-freetds-dir
--without-freetds-dir
--with-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
--with-sybdb-dir
--without-sybdb-dir
--with-sybdb-include
--without-sybdb-include=${sybdb-dir}/include
--with-sybdb-lib
--without-sybdb-lib=${sybdb-dir}/lib
--with-sybdblib
--without-sybdblib
--with-sybdblib
--without-sybdblib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/tiny_tds-2.1.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/tiny_tds-2.1.5/gem_make.out

@Largo
Copy link
Contributor

Largo commented May 26, 2022

Which shell/terminal are you using?
Cygwin? Try cmd or powershell. The \ character is apparently being as escape character. Try doubling it and see what happens (\ instead ) or quotes.

with-freetds-include=C:Ruby31-x64msys64ucrt64includefreetds

@jmunnik
Copy link

jmunnik commented Jun 4, 2022

When looking at https://rubygems.org/ it looks like ;

tiny_tds 2.1.5-x64-mingw32 -> REQUIRED RUBY VERSION: >= 2.4, < 2.8.DEV
tiny_tds 2.1.5 -> REQUIRED RUBY VERSION: >= 2.0.0

Does this work at all on ruby 3.x ?

@Largo or @ecentell-CPF I'm currently using Chef Infra Client, version 17.9.52 which is using ruby 3.x if I'm not mistaken.
What are the exact steps you took in order to resolve this ?

Beside the usual install I've also tried the following ;

  1. I've download https://sourceforge.net/projects/freetdswindows/files/FreeTDS-1.00/FreeTDS-1.00-x86.zip/download
  2. Extracted it in C:\freetds-1.00
  3. and executed C:\opscode\chef\embedded\bin> gem install tiny_tds -- --with-freetds-include=C:\freetds-1.00 from the command line on the Windows Server 2022 server.

See below the output when installing normally and with the actions as mentioned above.

<OUTPUT 1: Normal without actions mentioned above>

C:\opscode\chef\embedded\bin> gem install tiny_tds
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR:  Error installing tiny_tds:
        ERROR: Failed to build gem native extension.

    current directory: C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/opscode/chef/embedded/bin/ruby.exe -I C:/opscode/chef/embedded/lib/ruby/3.0.0 -r ./siteconf20220604-11896-z1r86f.rb extconf.rb
looking for freetds headers in the following directories:
 - /opt/local/include
 - /opt/local/include/freetds
 - /usr/local/include
 - /usr/local/include/freetds
looking for freetds library in the following directories:
 - /opt/local/lib
 - /opt/local/lib/freetds
 - /usr/local/lib
 - /usr/local/lib/freetds
checking for sybfront.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/opscode/chef/embedded/bin/$(RUBY_BASE_NAME)
        --help
        --with-freetds-dir
        --without-freetds-dir
        --with-freetds-include
        --without-freetds-include=${freetds-dir}/include
        --with-freetds-lib
        --without-freetds-lib=${freetds-dir}/lib
C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:482:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:624:in `try_cpp'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:1188:in `block in find_header'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:982:in `block in checking_for'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:361:in `block (2 levels) in postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:361:in `block in postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:981:in `checking_for'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:1187:in `find_header'
        from extconf.rb:59:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/gem_make.out
C:\opscode\chef\embedded\bin>cat C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/mkmf.log
"gcc -o conftest.exe -IC:/opscode/chef/embedded/include/ruby-3.0.0/x64-mingw32 -IC:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward -IC:/opscode/chef/embedded/include/ruby-3.0.0 -I. -I/opt/local/include -I/opt/local/include/freetds -I/usr/local/include -I/usr/local/include/freetds -IC:/opscode/chef/embedded/include -DFD_SETSIZE=2048 -m64 -march=x86-64 -O3 -D_WIN32_WINNT=0x0602 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -IC:/opscode/chef/embedded/include -DFD_SETSIZE=2048 -march=x86-64 -O3 conftest.c  -L. -LC:/opscode/chef/embedded/lib -L/opt/local/lib -L/opt/local/lib/freetds -L/usr/local/lib -L/usr/local/lib/freetds -L. -LC:/opscode/chef/embedded/lib -fno-lto  -m64   -lx64-msvcrt-ruby300  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
In file included from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby/missing.h:38:0,
                 from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby/defines.h:80,
                 from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:23,
                 from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from conftest.c:1:
c:\opscode\chef\embedded\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/ieeefp.h:6:22: fatal error: ansidecl.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */

<OUTPUT 2: with steps mentioned above>

C:\opscode\chef\embedded\bin> gem install tiny_tds -- --with-freetds-include=C:\freetds-1.00
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-freetds-include=C:\freetds-1.00'
This could take a while...
ERROR:  Error installing tiny_tds:
        ERROR: Failed to build gem native extension.

    current directory: C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/opscode/chef/embedded/bin/ruby.exe -I C:/opscode/chef/embedded/lib/ruby/3.0.0 -r ./siteconf20220604-1288-xbo2zz.rb extconf.rb --with-freetds-include\=C:\\freetds-1.00
looking for freetds headers in the following directories:
 - /opt/local/include
 - /opt/local/include/freetds
 - /usr/local/include
 - /usr/local/include/freetds
looking for freetds library in the following directories:
 - /opt/local/lib
 - /opt/local/lib/freetds
 - /usr/local/lib
 - /usr/local/lib/freetds
checking for sybfront.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/opscode/chef/embedded/bin/$(RUBY_BASE_NAME)
        --help
        --with-freetds-dir
        --without-freetds-dir
        --with-freetds-include=${freetds-dir}/include
        --with-freetds-lib
        --without-freetds-lib=${freetds-dir}/lib
C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:482:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:624:in `try_cpp'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:1188:in `block in find_header'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:982:in `block in checking_for'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:361:in `block (2 levels) in postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:361:in `block in postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:981:in `checking_for'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:1187:in `find_header'
        from extconf.rb:59:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/gem_make.out
C:\opscode\chef\embedded\bin>cat C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/gem_make.out
current directory: C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/opscode/chef/embedded/bin/ruby.exe -I C:/opscode/chef/embedded/lib/ruby/3.0.0 -r ./siteconf20220604-1288-xbo2zz.rb extconf.rb --with-freetds-include\=C:\\freetds-1.00
looking for freetds headers in the following directories:
 - /opt/local/include
 - /opt/local/include/freetds
 - /usr/local/include
 - /usr/local/include/freetds
looking for freetds library in the following directories:
 - /opt/local/lib
 - /opt/local/lib/freetds
 - /usr/local/lib
 - /usr/local/lib/freetds
checking for sybfront.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/opscode/chef/embedded/bin/$(RUBY_BASE_NAME)
        --help
        --with-freetds-dir
        --without-freetds-dir
        --with-freetds-include=${freetds-dir}/include
        --with-freetds-lib
        --without-freetds-lib=${freetds-dir}/lib
C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:482:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:624:in `try_cpp'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:1188:in `block in find_header'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:982:in `block in checking_for'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:361:in `block (2 levels) in postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:361:in `block in postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:331:in `open'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:357:in `postpone'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:981:in `checking_for'
        from C:/opscode/chef/embedded/lib/ruby/3.0.0/mkmf.rb:1187:in `find_header'
        from extconf.rb:59:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/mkmf.log

extconf failed, exit code 1
C:\opscode\chef\embedded\bin>cat C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/tiny_tds-2.1.5/mkmf.log
"gcc -o conftest.exe -IC:/opscode/chef/embedded/include/ruby-3.0.0/x64-mingw32 -IC:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward -IC:/opscode/chef/embedded/include/ruby-3.0.0 -I. -IC:\freetds-1.00 -IC:/opscode/chef/embedded/include -DFD_SETSIZE=2048 -m64 -march=x86-64 -O3 -D_WIN32_WINNT=0x0602 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -IC:/opscode/chef/embedded/include -DFD_SETSIZE=2048 -march=x86-64 -O3 conftest.c  -L. -LC:/opscode/chef/embedded/lib -L/opt/local/lib -L/opt/local/lib/freetds -L/usr/local/lib -L/usr/local/lib/freetds -L. -LC:/opscode/chef/embedded/lib -fno-lto  -m64   -lx64-msvcrt-ruby300  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
In file included from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby/missing.h:38:0,
                 from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby/defines.h:80,
                 from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:23,
                 from C:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from conftest.c:1:
c:\opscode\chef\embedded\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/ieeefp.h:6:22: fatal error: ansidecl.h: No such file or directory
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */

@jspraul
Copy link

jspraul commented Sep 26, 2022

TL;DR: FREETDS_DIR=/c/Ruby31-x64/msys64/ucrt64 gem install tiny_tds worked in bash.

I installed Ruby+Devkit 3.1.2-1 (x64) but use MINGW64 bash as configured within Visual Studio Code's Terminal:

$ mount
X:/TEMP on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C:/Program Files/Git on / type ntfs (binary,noacl,auto)
C:/Program Files/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)

gem install never had a problem finding the sybdb library, only the headers; the dependencies are located at:

$ ls /c/Ruby31-x64/msys64/ucrt64/include/freetds/syb*
/c/Ruby31-x64/msys64/ucrt64/include/freetds/sybdb.h  /c/Ruby31-x64/msys64/ucrt64/include/freetds/syberror.h  /c/Ruby31-x64/msys64/ucrt64/include/freetds/sybfront.h
$ ls /c/Ruby31-x64/msys64/ucrt64/lib/*sybdb*
/c/Ruby31-x64/msys64/ucrt64/lib/libsybdb.a  /c/Ruby31-x64/msys64/ucrt64/lib/libsybdb.dll.a

Looking at extconf.rb the FREETDS_DIR environment variable is added directly to the list of directories searched:

# Grab freetds environment variable for use by people on services like
# Heroku who they can't easily use bundler config to set directories
DIRS.unshift(ENV['FREETDS_DIR']) if ENV.has_key?('FREETDS_DIR')

With a bit of further fiddling (./include/freetds was appended automatically), the gem was successfully installed:

$ FREETDS_DIR=/c/Ruby31-x64/msys64/ucrt64 gem install tiny_tds
Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-freetds
Building native extensions. This could take a while...
Successfully installed tiny_tds-2.1.5
Parsing documentation for tiny_tds-2.1.5
Installing ri documentation for tiny_tds-2.1.5
Done installing documentation for tiny_tds after 1 seconds
1 gem installed

@pddzaic
Copy link

pddzaic commented Feb 20, 2023

The .exe files interestingly are at C:\Ruby31-x64\msys64\ucrt64\bin and are found.

Can you please explain which *.exe files you mean exactly?

I have the problem (Win 11 with Ruby 3.1.3p185), that the build of the gems works fine. Even require 'tiny_tds' returns true, but when trying to establish a connection the error Adaptive Server connection failed (localhost) (TinyTds::Error) .

With Ruby 2.7.6p219 and tiny_tds 2.1.5-x64-mingw32 everything works fine.

@ecentell-CPF
Copy link
Contributor Author

As per #530 this is working in 3.0

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

Successfully merging a pull request may close this issue.

7 participants