"mkmf.rb can't find header files for ruby"の対応

  • 57
    いいね
  • 0
    コメント
この記事は最終更新日から1年以上が経過しています。

今日のはまりどころ

$ gem install bson_ext -v '1.10.2'
Building native extensions.  This could take a while...
ERROR:  Error installing bson_ext:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.0 extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/ruby/include/ruby.h


Gem files will remain installed in /home/ec2-user/.gem/ruby/2.0/gems/bson_ext-1.10.2 for inspection.
Results logged to /home/ec2-user/.gem/ruby/2.0/gems/bson_ext-1.10.2/ext/cbson/gem_make.out

$ less /home/ec2-user/.gem/ruby/2.0/gems/bson_ext-1.10.2/ext/cbson/gem_make.out
/usr/bin/ruby2.0 extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/ruby/include/ruby.h

ぐぐる。

$ sudo yum -y install ruby-devel

いろんなものがgem install/bundle installできるようになった。