ruby-on-rails 无法在Windows上安装tiny_tds

jv4diomz  于 2023-06-07  发布在  Ruby
关注(0)|答案(1)|浏览(117)

我一直在尝试使用RubyGems在Windows上安装tiny_tds。我用的是Ruby 2.5.9p229。还安装了开发工具,但我总是得到以下错误.尝试使用和不使用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

这是mkmf.log文件。我什么也看不出来。

" -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 */

我想将我的Rails 5应用程序连接到MicrosoftSql Server。现在我使用Rails 4和jdbc-adapter。任何帮助都将非常感激!

yeotifhr

yeotifhr1#

显然,在安装DevKit之后,我必须通过在cmd上运行ridk enable来使MSYS2工具在PATH中可用。这解决了这个问题,我可以安装tiny_tds。

相关问题