安装rbtrace 0.4.14,带有本机扩展宝石:: ext :: builderror:错误:无法构建宝石本机扩展

发布于 2025-02-01 14:48:58 字数 1953 浏览 4 评论 0原文

在尝试安装话语时,这发生了几次:

Cannot install rbtrace with native extensions.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

*** 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/setoelka/.rbenv/versions/2.7.3/bin/$(RUBY_BASE_NAME)
extconf.rb:6:in `sys': make install failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
    from extconf.rb:43:in `block (2 levels) in <main>'
    from extconf.rb:34:in `chdir'
    from extconf.rb:34:in `block in <main>'
    from extconf.rb:30:in `chdir'
    from extconf.rb:30:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rbtrace-0.4.14/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rbtrace-0.4.14 for inspection.
Results logged to /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rbtrace-0.4.14/gem_make.out

An error occurred while installing rbtrace (0.4.14), and Bundler cannot continue.
Make sure that `gem install rbtrace -v '0.4.14' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rbtrace

有人知道这个问题吗?我尝试跑步:

gem install rbtrace -v '0.4.14' --source 'http://rubygems.org/' -- --with-cflags=-Wno-implicit-function-declaration

到目前为止没有运气。

This happened to me several times while trying to install Discourse:

Cannot install rbtrace with native extensions.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

*** 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/setoelka/.rbenv/versions/2.7.3/bin/$(RUBY_BASE_NAME)
extconf.rb:6:in `sys': make install failed, please report to https://github.com/tmm1/rbtrace/issues (RuntimeError)
    from extconf.rb:43:in `block (2 levels) in <main>'
    from extconf.rb:34:in `chdir'
    from extconf.rb:34:in `block in <main>'
    from extconf.rb:30:in `chdir'
    from extconf.rb:30:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rbtrace-0.4.14/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/rbtrace-0.4.14 for inspection.
Results logged to /Users/setoelka/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/extensions/arm64-darwin-21/2.7.0/rbtrace-0.4.14/gem_make.out

An error occurred while installing rbtrace (0.4.14), and Bundler cannot continue.
Make sure that `gem install rbtrace -v '0.4.14' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  rbtrace

Does anyone know about the problem? I tried running:

gem install rbtrace -v '0.4.14' --source 'http://rubygems.org/' -- --with-cflags=-Wno-implicit-function-declaration

No luck so far.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陪你搞怪i 2025-02-08 14:48:58

我通过查看mkmf.log内容来解决这个问题。

tldr;
使用标准命名的选定Xcode,即xcode.app

事实证明,Ruby将使用默认Xcode的编译器编译GEM。我有多个版本的Xcodes,并使用Xcode-select在它们之间切换。

问题是,Ruby设置将始终寻找默认的xcode.app命名。如果您将所选XCode命名为其他内容,您将获得此错误。

I solved this problem myself by looking at the mkmf.log content.

TLDR;
Use the selected Xcode with standard naming, i.e. Xcode.app.

It turned out that Ruby would compile the gem using the compiler from the default Xcode. I have multiple versions of Xcodes and use the xcode-select to switch between them.

The thing is, the ruby setup will always look for the default Xcode.app naming. You'll get this error if you name your selected Xcode something else.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文