I've been trying to install tiny_tds on Windows using RubyGems. I'm using Ruby 2.5.9p229. Also installed the Developer Tools but I'm always getting following error. Tried with and without freetds-dir.
C:\JenkinsWorkspaces\PMS_master@2>gem install tiny_tds -- --with-freetds-dir=C:\freetds-1.00
Building native extensions with: '--with-freetds-dir=C:\freetds-1.00'
This could take a while...
C:/jruby-9.2.9.0/lib/ruby/stdlib/rubygems/ext/builder.rb:76: warning: unsupported popen option: err
RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.
try_do at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:456
try_cpp at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:587
find_header at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:1144
checking_for at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:942
postpone at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:320
postpone at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:320
postpone at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:941
find_header at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:1143
<main> at extconf.rb:59
*** 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:/jruby-9.2.9.0/bin/jruby
--help
--with-freetds-dir
--with-freetds-include
--without-freetds-include=${freetds-dir}/include
--with-freetds-lib
--without-freetds-lib=${freetds-dir}/lib
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
current directory: C:/jruby-9.2.9.0/lib/ruby/gems/shared/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/jruby-9.2.9.0/bin/jruby.exe -I C:/jruby-9.2.9.0/lib/ruby/stdlib -r ./siteconf20230605-7896-nga75c.rb extconf.rb --with-freetds-dir\=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...
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/jruby-9.2.9.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.5.0/tiny_tds-2.1.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/jruby-9.2.9.0/lib/ruby/gems/shared/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/jruby-9.2.9.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.5.0/tiny_tds-2.1.5/gem_make.out
This is the mkmf.log file. Cannot make anything out of it.
" -o conftest.exe -I/include/universal-java1.8 -IC:/jruby-9.2.9.0/lib/ruby/include/ruby/backward -IC:/jruby-9.2.9.0/lib/ruby/include -I. -IC:\freetds-1.00/include -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions conftest.c -L. -LC:/jruby-9.2.9.0/lib -LC:\freetds-1.00/lib -LC:/jruby-9.2.9.0/lib/native/x86_64-Windows -m64 -march=native -mtune=native "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <ruby.h>
4: int main(int argc, char **argv)
5: {
6: return 0;
7: }
/* end */
I want to connect my Rails 5 app to MicrosoftSql Server. Now I use Rails 4 with jdbc-adapter. Any help would be really appreciated!
Apparently after installing the DevKit, I had to make the MSYS2 tools available in the PATH by running ridk enable
on cmd. This solved the issue and I was able to install tiny_tds.