我一直在尝试在 Windows 上为 Ruby 安装 taglib-ruby,但我不知道如何告诉 gem 安装程序在哪里寻找我的 taglib 副本。安装程序在 /usr/local/ 和其他类似的地方查找,但这是一台 Windows 机器,这些位置不存在,所以我不能只是将 taglib 移动到那里。我在 gem 的 github 页面上看到了这篇文章,它告诉您使用以下格式指定位置:CONFIGURE_ARGS="--with-opt-dir=Path/to/taglib" gem install taglib-ruby
,但这在 Windows PowerShell 中不起作用。我也试过这个公式:gem install taglib-ruby -- 'CONFIGURE_ARGS="--with-opt-dir=Path/to/taglib/"'
。但它同样不起作用。
我看到的错误信息是:
Temporarily enhancing PATH to include DevKit... Building native
extensions with: '--with-opt-dir=/hi/' This could take a while...
ERROR: Error installing taglib-ruby:
ERROR: Failed to build gem native extension.
current directory: C:/XXXXXXX/taglib_base C:/XXXXX/ruby.exe -r ./siteconf20161010-10032-1260rq7.rb extconf.rb --with-opt-dir=/hi/
checking for main() in -lstdc++... yes
checking for main() in -ltag... no
You must have taglib installed in order to use taglib-ruby.
Debian/Ubuntu: sudo apt-get install libtag1-dev
Fedora/RHEL: sudo yum install taglib-devel
Brew: brew install taglib
MacPorts: sudo port install taglib
*** 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
--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:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
--with-tag-dir
--without-tag-dir
--with-tag-include
--without-tag-include=${tag-dir}/include
--with-tag-lib
--without-tag-lib=${tag-dir}/lib
--with-stdc++lib
--without-stdc++lib
--with-taglib
--without-taglib
To see why this extension failed to compile, please check the mkmf.log
which can be found here:...
您可以看到 --with-opt-dir 是一个选项,但它没有设置,即使调用显示它是。关于如何使它工作的任何想法?
注意:我也尝试为“with-opt-dir”和“CONFIGURE_ARGS”设置环境变量,但它们也失败了。