ruby-debug Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers

吃可爱长大的小学妹 提交于 2019-11-27 15:26:33
skibum55

The error is in the mkmf.log file. That file should be located at /home/hxh/.rvm/gems/ruby-1.9.3-p448/gems/linecache-0.46/ext/linecache/mkmf.log.

If not, you can use

sudo find / -name mkmf.log

to find it.

To troubleshoot further, see "How to install Nokogiri Ruby gem with mkmf.log saying libiconv not found?"

Guster

I am using Mac El Capitan. In my case it was caused by the missing developer tool. I solved it by installing the developer tool via xcode-select --install. After that bundle install worked fine again.

You're most likely missing some file headers (e.g. zlib or libiconv), so try installing them.

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

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

Otherwise check your mkmf.log file for more specific details.

It seems to be a issue with permission of gcc.. however, if you're using OS X, you may encounter this issue if you've updated your XCode but haven't agree to their terms & conditions yet.. try typing gcc in your terminal would show you what if you've agreed.

etusm

For what it's worth, using Ruby 2.0.0 I was having this problem on OSX 10.10.

I ended up running brew update, which resolved some conflicts, then installed the gem and it was fine.

The answer of kenorb worked for me on Ubuntu 16.04 when I was trying installing rails! Thanks! I followed these steps below for installing rails:

  1. sudo apt-get install ruby-full
  2. sudo apt-get install libz-dev libiconv-hook1 libiconv-hook-dev
  3. sudo gem install rails
humbolight

My mkmf.log showed that gcc (4.8.2 I think) didn't like a specific argument that was being used by atomic on

$ gem install atomic

So I had a very similar situation. The answer for me was to upgrade gcc/gcc-libs and lib tool.

I use Arch linux, and only Arch linux. The proper way to do this is to run

$ sudo pacman -Syu

which upgrades all system packages.

I installed Rails and hadn't run a system update since, which is where the issue came from. In most other *nix distros, you would update to the latest version of these packages by name, i.e. with apt, it would be something along the lines of

$ sudo apt-get update

followed by

$ sudo apt-get upgrade {package-name}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!