首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >gem install ffi-yajl导致` `undefined method include_path`错误

gem install ffi-yajl导致` `undefined method include_path`错误
EN

Stack Overflow用户
提问于 2021-06-29 19:15:44
回答 2查看 88关注 0票数 2

我在尝试安装ffi-yajl时遇到以下错误

代码语言:javascript
运行
复制
Using berkshelf 4.3.3
Installing ffi-yajl 2.4.0 with native extensions
STDERR: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/var/lib/gems/2.5.0/gems/ffi-yajl-2.4.0/ext/ffi_yajl/ext/encoder
/usr/bin/ruby2.5 -r ./siteconf20210628-15489-1ggpxn5.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=/usr/bin/$(RUBY_BASE_NAME)2.5
extconf.rb:9:in <main>': undefined method include_path' for Libyajl2:Module
(NoMethodError)
Did you mean? include

extconf failed, exit code 1

似乎是这一行失败了:

https://github.com/chef/ffi-yajl/blob/master/ext/ffi_yajl/ext/encoder/extconf.rb#L9

不幸的是,我对Ruby的了解非常有限,我不知道是否应该定义'include_path‘,如果应该定义,那么为什么不定义它。

谢谢

EN

回答 2

Stack Overflow用户

发布于 2021-07-04 02:35:45

这应该会对你有帮助。以下是步骤:

  1. sudo apt删除ruby
  2. 安装ruby gem

来源:https://github.com/chef/ffi-yajl/issues/91

票数 0
EN

Stack Overflow用户

发布于 2021-07-08 21:15:18

正如Javier所指出的,我认为这与您没有安装所有必要的构建库有关。它可以安装在Ubuntu中,使用以下命令:

代码语言:javascript
运行
复制
sudo apt install build-essential

我认为Fedora的等价物是:

代码语言:javascript
运行
复制
sudo dnf groupinstall "Development Tools" "Development Libraries"

安装以下库后,您可以再试一次。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68177644

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档