我在Amazon EC2实例上运行ubuntu 14.04.3 LTS。任何帮助解决此错误都将非常感激。
键入sudo gem install mongo
会产生以下结果:
Fetching: bson-3.2.1.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing mongo:
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:1:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/bson-3.2.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/bson-3.2.1/ext/bson/gem_make.out
答案 0 :(得分:2)
另一个问题 - `require': no such file to load -- mkmf (LoadError) - 有一个答案可以解决你的问题;
sudo apt-get install ruby1.9.1-dev
sudo apt-get install ruby-dev