红联Linux门户
Linux帮助

ubuntu16.04安装gem install rails报错解决

发布时间:2016-12-12 10:30:09来源:linux网站作者:yanchengyc
当执行gem install rails时报错,报错信息:
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.14 for inspection
Results logged to /Library/Ruby/Gems/2.0.0/gems/atomic-1.1.14/ext/gem_make.out
 
解决办法:
1.gem update --system
2.sudo apt-get install ruby-dev
 
本文永久更新地址:http://www.linuxdiyf.com/linux/26829.html