ruby on rails安装JSON ubuntu错误

时间:2021-12-09 07:34:17

Hey I am new to rails (as well as linux) and I keep getting this error:

嘿,我是rails(以及linux)的新手,我一直收到这个错误:

Installing json (1.7.5) with native extensions Gem::Installer::ExtensionBuildError: 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 /home/jack/.bundler/tmp/10426/gems/json-1.7.5 for inspection.Results logged to /home/jack/.bundler/tmp/10426/gems/json-1.7.5/ext/json/ext/generator/gem_make.outAn error occurred while installing json (1.7.5), and Bundler cannot continue.Make sure that `gem install json -v '1.7.5'` succeeds before bundling.jack@jack-ThinkCentre:~/rails_projects/sample_app$ 

I cant install the gem individually or with bundle install. I used rvm to install rails. thanks in advance.

我无法单独安装gem或使用bundle install。我用rvm来安装rails。提前致谢。

2 个解决方案

#1


10  

Installing the ruby1.9.1-dev package should fix this for you

安装ruby1.9.1-dev软件包应该为您解决这个问题

sudo apt-get install ruby1.9.1-dev

#2


2  

"The same issue on ubuntu-trusty-64 running ruby 2.2.3. the solution is to install libgmp3-dev."

“在运行ruby 2.2.3的ubuntu-trusty-64上也存在相同的问题。解决方案是安装libgmp3-dev。”

sudo apt-get install libgmp3-dev

#1


10  

Installing the ruby1.9.1-dev package should fix this for you

安装ruby1.9.1-dev软件包应该为您解决这个问题

sudo apt-get install ruby1.9.1-dev

#2


2  

"The same issue on ubuntu-trusty-64 running ruby 2.2.3. the solution is to install libgmp3-dev."

“在运行ruby 2.2.3的ubuntu-trusty-64上也存在相同的问题。解决方案是安装libgmp3-dev。”

sudo apt-get install libgmp3-dev