当前位置: 首页>>技术教程>>正文


ruby – 无法安装路缘 gems

, , , ,

问题描述

它给我的错误

 gem install curb
Building native extensions.  This could take a while...
ERROR:  Error installing curb:
    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/user1/.rvm/gems/ruby-1.9.3-p392/gems/curb-0.8.3 for inspection.
Results logged to /home/user1/.rvm/gems/ruby-1.9.3-p392/gems/curb-0.8.3/ext/gem_make.out

rvm列表

rvm rubies

   ruby-1.9.3-p385 [ broken ]
=* ruby-1.9.3-p392 [ x86_64 ]
   ruby-2.0.0-p0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default


user1@ubuntu:~$ sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libcurl3-gnutls is already the newest version.
libcurl4-openssl-dev is already the newest version.
libcurl3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

我如何解决它?

最佳方案

我记得它使用curl库来本地编译

因此,您将需要安装curl dev libs并尝试安装

sudo apt-get install libcurl4-openssl-dev

要么

sudo apt-get install libcurl4-gnutls-dev

次佳方案

在浅顶软呢帽上,我做了sudo yum install curl-devel,然后做了gem install curb,这对我有用

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/9488.html,未经允许,请勿转载。