无法在Windows上安装tiny_tds。

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

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.

  1. C:\JenkinsWorkspaces\PMS_master@2>gem install tiny_tds -- --with-freetds-dir=C:\freetds-1.00
  2. Building native extensions with: '--with-freetds-dir=C:\freetds-1.00'
  3. This could take a while...
  4. C:/jruby-9.2.9.0/lib/ruby/stdlib/rubygems/ext/builder.rb:76: warning: unsupported popen option: err
  5. RuntimeError: The compiler failed to generate an executable file.
  6. You have to install development tools first.
  7. try_do at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:456
  8. try_cpp at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:587
  9. find_header at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:1144
  10. checking_for at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:942
  11. postpone at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:350
  12. open at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:320
  13. postpone at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:350
  14. open at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:320
  15. postpone at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:346
  16. checking_for at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:941
  17. find_header at C:/jruby-9.2.9.0/lib/ruby/stdlib/mkmf.rb:1143
  18. <main> at extconf.rb:59
  19. *** extconf.rb failed ***
  20. Could not create Makefile due to some reason, probably lack of necessary
  21. libraries and/or headers. Check the mkmf.log file for more details. You may
  22. need configuration options.
  23. Provided configuration options:
  24. --with-opt-dir
  25. --without-opt-dir
  26. --with-opt-include
  27. --without-opt-include=${opt-dir}/include
  28. --with-opt-lib
  29. --without-opt-lib=${opt-dir}/lib
  30. --with-make-prog
  31. --without-make-prog
  32. --srcdir=.
  33. --curdir
  34. --ruby=C:/jruby-9.2.9.0/bin/jruby
  35. --help
  36. --with-freetds-dir
  37. --with-freetds-include
  38. --without-freetds-include=${freetds-dir}/include
  39. --with-freetds-lib
  40. --without-freetds-lib=${freetds-dir}/lib
  41. ERROR: Error installing tiny_tds:
  42. ERROR: Failed to build gem native extension.
  43. current directory: C:/jruby-9.2.9.0/lib/ruby/gems/shared/gems/tiny_tds-2.1.5/ext/tiny_tds
  44. 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
  45. looking for freetds headers in the following directories:
  46. - /opt/local/include
  47. - /opt/local/include/freetds
  48. - /usr/local/include
  49. - /usr/local/include/freetds
  50. looking for freetds library in the following directories:
  51. - /opt/local/lib
  52. - /opt/local/lib/freetds
  53. - /usr/local/lib
  54. - /usr/local/lib/freetds
  55. checking for sybfront.h...
  56. To see why this extension failed to compile, please check the mkmf.log which can be found here:
  57. 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
  58. extconf failed, exit code 1
  59. Gem files will remain installed in C:/jruby-9.2.9.0/lib/ruby/gems/shared/gems/tiny_tds-2.1.5 for inspection.
  60. 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.

  1. " -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 "
  2. checked program was:
  3. /* begin */
  4. 1: #include "ruby.h"
  5. 2:
  6. 3: #include <ruby.h>
  7. 4: int main(int argc, char **argv)
  8. 5: {
  9. 6: return 0;
  10. 7: }
  11. /* 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:

确定