简体   繁体   English

错误:无法构建 gem 本机扩展。 M1 芯片未找到potracelib.h

[英]ERROR: Failed to build gem native extension. potracelib.h not found with M1 chip

I'm trying to install a Rails 5 app in my Macbook Air with M1 chip.我正在尝试在带有 M1 芯片的 Macbook Air 中安装 Rails 5 应用程序。 This app is using a gem called potracer .这个应用程序使用了一个叫做potracer的 gem。

After doing $ bundle install I get the error:执行$ bundle install后出现错误:

Installing potracer 1.1.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/user/.rvm/gems/ruby-2.7.2/gems/potracer-1.1.4/ext/potracer
/Users/user/.rvm/rubies/ruby-2.7.2/bin/ruby -I /Users/user/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20211025-1533-nnxnj9.rb extconf.rb
checking for potracelib.h... no
potracelib.h not found
*** 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=/Users/user/.rvm/rubies/ruby-2.7.2/bin/$(RUBY_BASE_NAME)
    --with-potrace-dir
    --without-potrace-dir
    --with-potrace-include
    --without-potrace-include=${potrace-dir}/include
    --with-potrace-lib
    --without-potrace-lib=${potrace-dir}/lib

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

  /Users/user/.rvm/gems/ruby-2.7.2/extensions/arm64-darwin-20/2.7.0/potracer-1.1.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.7.2/gems/potracer-1.1.4 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.7.2/extensions/arm64-darwin-20/2.7.0/potracer-1.1.4/gem_make.out

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

In Gemfile:
  potracer

I had other issues installing other rails app with the M1 chip but I found workarounds but not in this case.我在使用 M1 芯片安装其他 rails 应用程序时遇到了其他问题,但我找到了解决方法,但在这种情况下没有。

Ideas on how to solved this?关于如何解决这个问题的想法?

I am not an potrace expert but I thing you have to reinstall potrace loccaly before.我不是potrace专家,但我认为你必须在本地重新安装potrace。 The installation seems to be incomplete.安装似乎不完整。 Not linked to your chip.没有链接到你的芯片。

The potrace execution will abort unless you get the potrace.h locally除非您在本地获得 potrace.h,否则potrace 执行将中止

abort potracelib.h not found' unless find_header('potracelib.h')中止potracelib.h未找到'除非find_header('potracelib.h')

    require 'mkmf'

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

LIBDIR = RbConfig::CONFIG['libdir']
INCLUDEDIR = RbConfig::CONFIG['includedir']

HEADER_DIRS = ['/opt/local/include', '/usr/local/include', INCLUDEDIR,
               '/usr/include']

LIB_DIRS = ['/opt/local/lib', '/usr/local/lib', LIBDIR, '/usr/lib']

dir_config('potrace', HEADER_DIRS, LIB_DIRS)

abort 'potracelib.h not found' unless find_header('potracelib.h')
abort 'lib potrace not found' unless find_library('potrace', 'potrace_version')

create_header
create_makefile('potracer/potracer')

Source: https://github.com/kennyp/potracer/blob/b67d3ff6a1ae672ccc6701fa5245fa532b461ef3/ext/potracer/extconf.rb来源: https : //github.com/kennyp/potracer/blob/b67d3ff6a1ae672ccc6701fa5245fa532b461ef3/ext/potracer/extconf.rb

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 nokogiri gem - 错误:无法构建 gem 本机扩展。 - nokogiri gem - ERROR: Failed to build gem native extension. 错误:无法生成gem本机扩展。 JSON宝石 - ERROR: Failed to build gem native extension. JSON Gem 如何解决“错误:无法构建gem本机扩展。” - How to resolve “ERROR: Failed to build gem native extension.” "<i>&quot;ERROR: Failed to build gem native extension.&quot;<\/i> “错误:无法构建 gem 原生扩展。”<\/b> <i>while installing Rails<\/i>在安装 Rails 时<\/b>" - "ERROR: Failed to build gem native extension." while installing Rails 带有本机扩展的 MySQL2 错误:无法构建 gem 本机扩展。 (宝石::安装程序::ExtensionBuildError) - MySQL2 with native extensions ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) `build_extensions':错误:无法构建gem原生扩展。 (宝石::安装:: ExtensionBuildError) - `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) Gem :: Ext :: BuildError:错误:无法构建gem本机扩展。 GCC错误 - Gem::Ext::BuildError: ERROR: Failed to build gem native extension. GCC error 捆绑安装:错误:无法构建gem原生扩展。 nio4r宝石 - Bundle install: ERROR: Failed to build gem native extension. nio4r gem Amazon EC2 - Gem :: Installer :: ExtensionBuildError:错误:无法构建gem原生扩展。 (JSON) - Amazon EC2 - Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. (JSON) Gem::Ext::BuildError: 错误:无法构建 gem 本机扩展。 对于 SQLite3 - Gem::Ext::BuildError: ERROR: Failed to build gem native extension. for SQlite3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM