ruby 无法安装遏制宝石

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16162266/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 05:54:00  来源:igfitidea点击:

Unable to install curb gem

rubyubuntucurlgemubuntu-12.10

提问by Alan Coromano

It gives me the error of

它给了我错误

 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.

How do I fix it?

我如何解决它?

回答by Pritesh Jain

As I remember it uses curl libs to compile natively

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

So you will need curl dev libs installed try installing

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

sudo apt-get install libcurl4-openssl-dev

or

或者

sudo apt-get install libcurl4-gnutls-dev

回答by Joseph N.

On fedora I did sudo yum install curl-develand then did gem install curband that did the trick for me

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

回答by Tr?n Vi?t Hoàng

On Ubuntu 14.04, besides the libcurl packages mentioned by PriteshJ, I also have to install ruby-dev package to make it works:

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

sudo apt-get install ruby-dev

sudo apt-get install ruby​​-dev

回答by Hearen

In Ubuntu 18.04, using

Ubuntu 18.04 中,使用

sudo apt install libcurl4-openssl-dev

and then install curb

然后安装 curb

gem install curb

回答by Moin Haidar

On Ubuntu, the dependencies can be satisfied by installing the following packages:

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

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

On RedHat:

在红帽上:

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

回答by Matt Konda

I recently had this problem on an ubuntu 14.04 docker image with curb 0.9.0 and solved it by installing libgmp-dev (in addition to the suggestions from the curb page already mentioned: libcurl3 libcurl3-gnutls libcurl4-openssl-dev).

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