在ubuntu下安装rails时,我尝试了以下命令:
sudo apt-get install ruby
sudo gem install rails
结果在安装rails时得到了如下错误
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:13:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/atomic-1.1.13 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/atomic-1.1.13/ext/gem_make.out
上网搜索了一番,找到原因说是没有安装 build-essential,
linux操作系统上面开发程序, 光有了gcc 是不行的
它还需要一个 build-essential软件包
作用是