首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >由于某种原因,ruby-debug无法创建Makefile,可能缺少所需的库和/或头文件

由于某种原因,ruby-debug无法创建Makefile,可能缺少所需的库和/或头文件
EN

Stack Overflow用户
提问于 2013-10-31 10:21:25
回答 11查看 101.1K关注 0票数 46

我的Rails是3.2.1.4,Ruby是1.9.3p448

安装ruby-debug时出现错误

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

    /home/hxh/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
Can't handle 1.9.x yet
*** 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=/home/hxh/.rvm/rubies/ruby-1.9.3-p448/bin/ruby


Gem files will remain installed in /home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46 for inspection.
Results logged to /home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46/ext/gem_make.out

谁能告诉我错误在哪里?

EN

回答 11

Stack Overflow用户

回答已采纳

发布于 2013-12-07 06:03:30

错误在mkmf.log文件中。该文件应该位于/home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46/ext/linecache/mkmf.log

如果不是,您可以使用

sudo find / -name mkmf.log

才能找到它。

要进一步排除故障,请参阅"How to install Nokogiri Ruby gem with mkmf.log saying libiconv not found?

票数 20
EN

Stack Overflow用户

发布于 2016-03-10 11:57:30

我使用的是Mac El Capitan。在我的例子中,这是由于缺少开发人员工具造成的。我通过xcode-select --install安装开发人员工具解决了这个问题。在此之后,捆绑包安装再次正常工作。

票数 18
EN

Stack Overflow用户

发布于 2016-07-09 09:15:05

您很可能缺少一些文件头(例如zlib或libiconv),因此请尝试安装它们。

Linux:sudo apt-get install libz-dev libiconv-hook1 libiconv-hook-dev

OS X:brew install libiconv && xcode-select --install

否则,请检查您的mkmf.log文件以获取更具体的详细信息。

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

https://stackoverflow.com/questions/19697359

复制
相关文章

相似问题

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