oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
645 stars 248 forks source link

tiny_tds don't compile on ruby 3.1.3 on W10 #319

Closed net1957 closed 1 year ago

net1957 commented 1 year ago

What problems are you experiencing?

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...
ERROR:  Error installing tiny_tds:
        ERROR: Failed to build gem native extension.

    current directory: D:/program/dvlt/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/ext/tiny_tds
D:/program/dvlt/ruby/Ruby31-x64/bin/ruby.exe -I D:/program/dvlt/ruby/Ruby31-x64/lib/ruby/site_ruby/3.1.0 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... 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=D:/program/dvlt/ruby/Ruby31-x64/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
        --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:

  D:/program/dvlt/ruby/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 D:/program/dvlt/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to D:/program/dvlt/ruby/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/tiny_tds-2.1.5/gem_make.out

Steps to reproduce

gem install tiny_tds

What's the output from ridk version?


ruby: path: D:/program/dvlt/ruby/Ruby31-x64 version: 3.1.3 platform: x64-mingw-ucrt ruby_installer: package_version: 3.1.3-1 git_commit: a09714d msys2: path: D:\program\dvlt\ruby\msys64 cc: gcc (Rev6, Built by MSYS2 project) 12.2.0 sh: GNU bash, version 5.2.9(1)-release (x86_64-pc-msys) os: Microsoft Windows [version 10.0.19045.2311]

mingw-w64-ucrt-x86_64-freetds is installed the headers are in D:\program\dvlt\ruby\msys64\ucrt64\include\freetds log file: mkmf.log

Any idea?

MSP-Greg commented 1 year ago

Have you tried the below? Seemed to work for me...

gem install tiny_tds -- --with-freetds-include=D:/program/dvlt/ruby/msys64/ucrt64/include/freetds
net1957 commented 1 year ago

@MSP-Greg ,

Thanks for this advice. It work. And the same apply to this tiny_tds gem on ruby 3.0.5 ... (but use mingw64) gem install tiny_tds -- --with-freetds-include=D:/program/dvlt/ruby/msys64/mingw64/include/freetds