背景:
1. ruby的安装方式:sudo apt-get install ruby
2. mongod服务已开启
3. ruby版本:2.3, gem已安装
安装驱动的步骤:
1. gem install mongo
Error: you don't have write permission
2. sudo gem install mongo
Error: failed to build gem native extension
解决方法:
1. 首先执行命令:sudo apt-get install ruby-all-dev
2. 再次执行命令:sudo gem install mongo
结果:2 gems installed, bson和mongo成功安装。