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

后端 未结 9 1964
清歌不尽
清歌不尽 2020-12-03 16:53

My Rails is 3.2.1.4, Ruby is 1.9.3p448.

I got an error when I install ruby-debug:

Building native extensions.          


        
相关标签:
9条回答
  • 2020-12-03 17:06

    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?"

    0 讨论(0)
  • 2020-12-03 17:07

    This worked for me. Nokogiri was the problem.

    Try the following if you are using Alpine-Linux(or equivalent command for your OS)

    apk add build-base
    

    And then install nokogiri as given below

    gem install nokogiri -- --without-pkg-config --with-libxml-2.0-config
    
    0 讨论(0)
  • 2020-12-03 17:15

    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.

    0 讨论(0)
  • 2020-12-03 17:23

    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
    0 讨论(0)
  • 2020-12-03 17:24

    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.

    0 讨论(0)
  • 2020-12-03 17:24

    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.

    0 讨论(0)
提交回复
热议问题