当我bundle install
在终端上使用命令时(虽然我已连接到数字海洋服务器),我不断收到此错误.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /usr/local/rvm/gems/ruby-2.2.3/gems/json-1.8.3/ext/json/ext/generator /usr/local/rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20151226-8411-15s6u34.rb extconf.rb creating Makefile current directory: /usr/local/rvm/gems/ruby-2.2.3/gems/json-1.8.3/ext/json/ext/generator make "DESTDIR=" clean current directory: /usr/local/rvm/gems/ruby-2.2.3/gems/json-1.8.3/ext/json/ext/generator make "DESTDIR=" compiling generator.c linking shared-object json/ext/generator.so /usr/bin/ld: cannot find -lgmp collect2: error: ld returned 1 exit status make: *** [generator.so] Error 1 make failed, exit code 2 Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.3/gems/json-1.8.3 for inspection. Results logged to /usr/local/rvm/gems/ruby-2.2.3/extensions/x86_64-linux/2.2.0/json-1.8.3/gem_make.out
这对于大多数宝石而言它们都略有不同,但他们都说"无法构建宝石原生扩展".我到处寻找,我不完全确定发生了什么.
我假设错误发生在json-1.8.3
gem中,因此尝试
sudo apt-get install libgmp3-dev
然后再bundle install
看看它是否已修复.