当前位置: 首页 > 面试题库 >

为什么在Ubuntu中安装JSON gem时会出错?

龙俊德
2023-03-14
问题内容

使用Ubuntu,当我运行“ bundle install”以设置我的Rails环境时,它会在JSON gem安装过程中引发错误:

Installing json (1.7.3) 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/danny/.bundler/tmp/2040/gems/json-1.7.3 for inspection.
Results logged to /home/danny/.bundler/tmp/2040/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.

当我尝试仅安装JSON 1.7.3 gem时,它也给我一个错误:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
    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/json-1.7.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/json-1.7.3/ext/json/ext/parser/gem_make.out

我已经安装了RVM并正在运行Ruby 1.9.3;为什么它不能安装JSON gem?


问题答案:

安装ruby1.9.1-dev软件包可以为您解决此问题:

sudo apt-get install ruby1.9.1-dev


 类似资料:
  • 面向Web开发人员的Eclipse Java EE IDE。 版本:Juno Service Release 1 构建ID:20120920-0800 默认情况下,M2E不安装在此版本中,但它可以在标准更新站点中获得。 我试图在其中安装M2E,方法是查看Help-->install New Software,然后选择“Juno-http://download.eclipse.org/release

  • 请帮我做这个,谢谢。

  • 当我尝试在ubuntu上安装Yeoman时,我得到了以下错误。 编辑 尝试MortezaLSC的解决方案后-我得到以下错误

  • HTTP请求已发送,正在等待响应...404找不到2018-07-18 14:49:48错误404:找不到。

  • 我一直在尝试在ubuntu16上安装xampp(5.6.24)。04,但我遇到了以下错误- /opt/lampp/etc/httpd的第136行出现语法错误。conf:无法加载模块/mod_ssl。所以进入服务器:/opt/lampp/modules/mod_ssl。所以:无法打开共享对象文件:没有这样的文件或目录 我尝试过在互联网上搜索,但是找不到任何专门针对ubuntu的东西。 任何建议都可能

  • 问题内容: 我没有直接依赖于weak或node-gyp,但是我想我的其他依赖项(express,phantom,ejs,aws- sdk,moment)都需要它。任何人都遇到这样的问题并能够解决? 问题答案: 这是有效的。在安装过程中需要python 2.6。 https://github.com/TooTallNate/node- gyp/issues/363