无法在Windows上安装tiny_tds。

huangapple go评论60阅读模式
英文:

Cannot install tiny_tds on Windows

问题

抱歉,以下是您提供的内容的翻译:

"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."

"我一直在尝试使用RubyGems在Windows上安装tiny_tds。我正在使用Ruby 2.5.9p229。我也安装了开发工具,但总是遇到以下错误。尝试过使用freetds-dir和不使用freetds-dir。"

"This is the mkmf.log file. Cannot make anything out of it."

"这是mkmf.log文件。我无法理解其中的内容。"

"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!"

"我想将我的Rails 5应用程序连接到Microsoft SQL Server。现在我正在使用带有jdbc-adapter的Rails 4。任何帮助将不胜感激!"

英文:

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!

答案1

得分: 0

显然,在安装DevKit之后,我必须通过在命令提示符中运行ridk enable来将MSYS2工具添加到PATH中。这解决了问题,我能够安装tiny_tds。

英文:

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.

huangapple
  • 本文由 发表于 2023年6月5日 22:56:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/76407698.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定