无法安装路缘宝石

时间:2013-04-23 06:15:53

标签: ruby ubuntu curl gem ubuntu-12.10

它给了我

的错误
 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 list

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.

我该如何解决?

6 个答案:

答案 0 :(得分:67)

我记得它使用curl libs本地编译

所以你需要安装curl dev libs 尝试安装

sudo apt-get install libcurl4-openssl-dev

sudo apt-get install libcurl4-gnutls-dev

答案 1 :(得分:7)

在Fedora上我做了sudo yum install curl-devel然后做了gem install curb这对我来说就是这个伎俩

答案 2 :(得分:2)

在Ubuntu 14.04上,除了PriteshJ提到的libcurl包之外,我还必须安装ruby-dev包才能使它工作:

  

sudo apt-get install ruby​​-dev

答案 3 :(得分:0)

在Ubuntu上,可以通过安装以下软件包来满足依赖关系:

$ sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev

On RedHat:

$ sudo yum install ruby-devel libcurl-devel openssl-devel

答案 4 :(得分:0)

我最近在一个带有curb 0.9.0的ubuntu 14.04 docker镜像上遇到了这个问题并通过安装libgmp-dev解​​决了它(除了已经提到的curb页面的建议:libcurl3 libcurl3-gnutls libcurl4-openssl-dev)

答案 5 :(得分:0)

Ubuntu 18.04 中,使用

sudo apt install libcurl4-openssl-dev

然后安装curb

gem install curb