bson 4.0.0 gem错误

时间:2016-01-10 12:33:50

标签: ruby ubuntu rubygems bson

安装bson gem时出现此错误:(ruby 2.2.2,ubuntu 14.04 clean)

ubuntu:/var/apps/real-fetcher$ gem install bson -v '4.0.0'
Building native extensions.  This could take a while...
ERROR:  Error installing bson:
    ERROR: Failed to build gem native extension.

    /home/ubuntu/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20160110-7126-18thkio.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling native.c
In file included from native.c:21:0:
native-endian.h:113:17: warning: '__bson_uint32_swap_slow' defined but not used [-Wunused-function]
 static uint32_t __bson_uint32_swap_slow(uint32_t v)
             ^
native-endian.h:137:17: warning: '__bson_uint64_swap_slow' defined but not used [-Wunused-function]
 static uint64_t __bson_uint64_swap_slow(uint64_t v)
             ^
native-endian.h:164:15: warning: '__bson_double_swap_slow' defined but not used [-Wunused-function]
 static double __bson_double_swap_slow(double v)
           ^
linking shared-object native.so
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
make: *** [native.so] Error 1

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/.rvm/gems/ruby-2.2.2/gems/bson-4.0.0 for inspection.
Results logged to /home/ubuntu/.rvm/gems/ruby-2.2.2/extensions/x86_64-linux/2.2.0/bson-4.0.0/gem_make.out

无法找到与我的搜索相关的任何内容。

我还没有尝试任何东西,我不知道该尝试什么。

1 个答案:

答案 0 :(得分:1)

必须这样做:

sudo apt-get install libgmp-dev