gpt4 book ai didi

ruby - 安装错误 rb-appscript extconf.rb 失败

转载 作者:太空宇宙 更新时间:2023-11-03 16:46:46 27 4
gpt4 key购买 nike

对此很陌生,所以我一直在尝试解决这个问题,但无法找到答案。

gem update --system

安装 rb-appscript 时出现以下错误。

gem install rb-appscript

Building native extensions. This could take a while...
ERROR: Error installing rb-appscript: ERROR: Failed to build gem native extension.

/Users/Dz/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20150719-5167-en4sxa.rb extconf.rb

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=/Users/Dz/.rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME)
extconf.rb:44:in `': uninitialized constant Config (NameError)

extconf failed, exit code 1

Gem files will remain installed in /Users/Dz/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/rb-appscript-0.6.1 for inspection.
Results logged to /Users/Dz/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/rb-appscript-0.6.1/gem_make.out

最佳答案

首先,我希望您喜欢 Ruby。 :-)

Config 模块在 Ruby 1.9 前后被重命名并弃用为 RbConfig(不确定具体时间)。 Config 在 Ruby 2 中被完全删除,因此出现了 uninitialized constant Config fatal error 。

如果您碰巧使用的是 1.9.x 而不是 2.2.2,您会看到弃用警告,这可能会提示您。

(localhost) ~ ruby -e "puts Config::CONFIG['RUBY_PROGRAM_VERSION']"
-e:1: Use RbConfig instead of obsolete and deprecated Config.
1.9.3
(localhost) ~ ruby -e "puts RbConfig::CONFIG['RUBY_PROGRAM_VERSION']"
1.9.3
(localhost) ~ rbenv shell 2.2.3
(localhost) ~ ruby -e "puts Config::CONFIG['RUBY_PROGRAM_VERSION']"
-e:1:in `<main>': uninitialized constant Config (NameError)
(localhost) ~ ruby -e "puts RbConfig::CONFIG['RUBY_PROGRAM_VERSION']"
2.2.3

如果你想使用 rb-appscript,你可能会使用 Ruby 1.9,但我从未使用过那个 gem,所以我不能具体说。

(您可以使用 rbenv 及其 ruby-build 插件轻松安装 1.9 版本。)

关于ruby - 安装错误 rb-appscript extconf.rb 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31504945/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com