无法在 Windows 10 中安装tiny_tds
当我运行时:
gem install tiny_tds
输出告诉我需要安装 FreeTDS。接下来,它向我展示了一些配置选项,我可能需要一个选项。选项如下:
--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:/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
问题是这些选项都不起作用。以下是所发生情况的示例:
C:\RailsApps>gem install tiny_tds -- --with-freetds-dir
Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-freetds
Building native extensions with: '--with-freetds-dir'
This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220308-11104-
42q9r4.rb extconf.rb --with-freetds-dir
*** 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:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
--help
--with-freetds-dir
C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1807:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
^^^^^^
from extconf.rb:56:in `<main>'
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
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/tiny_tds-2.1.5/gem_make.out
我找到了下载的 FreeTDS 二进制文件来尝试 Windows 手动安装,但我不知道将它们放在哪里或如何使用它们。
When I run:
gem install tiny_tds
The output tells me that I need FreeTDS installed. Next, it shows me some configuration options and that I'll probably need an option. The options are the following:
--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:/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
The problem is that none of the options work. Here´s an example of what happens:
C:\RailsApps>gem install tiny_tds -- --with-freetds-dir
Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-freetds
Building native extensions with: '--with-freetds-dir'
This could take a while...
ERROR: Error installing tiny_tds:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5/ext/tiny_tds
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r ./siteconf20220308-11104-
42q9r4.rb extconf.rb --with-freetds-dir
*** 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:/Ruby31-x64/bin/$(RUBY_BASE_NAME)
--help
--with-freetds-dir
C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:1807:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
defaults = Array === dir ? dir : dir.split(File::PATH_SEPARATOR)
^^^^^^
from extconf.rb:56:in `<main>'
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
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/tiny_tds-2.1.5 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/tiny_tds-2.1.5/gem_make.out
I found an downloaded the FreeTDS binaries to try the Windows manual installation, but I don´t know where to place them or how to use them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过查看 freetds windows zipfile 和安装的 pacman 软件包,我通过之前的帖子找到了答案。
它可能正在 C:\Ruby31-x64\msys64\ucrt64\include 中查找包含文件夹标头
然而它位于 C:\Ruby31-x64\msys64\ucrt64\include\freetds
有趣的是,.exe 文件位于 C:\Ruby31-x64\msys64\ucrt64\bin 并可找到。
另请参阅:Tiny TDS GitHub 问题 503
I figured it out thanks to the previous posts, by looking at the freetds windows zipfile and the installed pacman package.
It's probably looking for the include folder headers at C:\Ruby31-x64\msys64\ucrt64\include
However it is at C:\Ruby31-x64\msys64\ucrt64\include\freetds
The .exe files interestingly are at C:\Ruby31-x64\msys64\ucrt64\bin and are found.
also see: Tiny TDS GitHub Issue 503
好吧,多亏了 Jared Beck,我终于能够预编译 FreeTDS 二进制文件了。我过去使用过 Ruby on Rails,但从未需要做这样的事情,所以我不知道语法。我认为运行命令
gem install tiny_tds
包含 FreeTDS 安装。然后我注意到配置选项并尝试运行 gem install tiny_tds -- --with-freetds-dir ,但不知道该命令需要目录作为参数。最后,我从 https://sourceforge.net/projects/freetdswindows/ 下载了 FreeTDS Windows 二进制文件,将其解压到 C: 中,然后运行以下命令:
Well, thanks to Jared Beck, I finally was able to precompile the FreeTDS binaries. I used Ruby on Rails in the past, but never needed to do such thing, so I didn´t know the syntax. I thought that running the command
gem install tiny_tds
included the FreeTDS installation. Then I noticed the configuration options and tried runninggem install tiny_tds -- --with-freetds-dir
, but didn´t know that the command required the directory as an argument.Finally, I downloaded the FreeTDS Windows binary from https://sourceforge.net/projects/freetdswindows/, extracted it in C:, and ran the following command: