我正在尝试在Ubuntu 11.04上安装Rails环境。当我启动命令rvm install 1.9.2——with-openssl-dir=/usr/local时,收到以下错误:

curl : (1) Protocol https not supported or disabled in libcurl

如何解决这个问题?


当前回答

在libcurl常见问题解答条目“libcurl不支持或禁用协议xxx”中特别提到了这一点。

为了让你开心,我在这里也嵌入了解释:

When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message is phrased is because curl doesn't make a distinction internally of whether a particular protocol is not supported (ie never got any code added that knows how to speak that protocol) or if it was explicitly disabled. curl can be built to only support a given set of protocols, and the rest would then be disabled or not supported. Note that this error will also occur if you pass a wrongly spelled protocol part as in "htpt://example.com" or as in the less evident case if you prefix the protocol part with a space as in " http://example.com/".

其他回答

用flag -with-darwinssl解决了这个问题

转到带有curl源代码的文件夹

请在这里下载https://curl.haxx.se/download.html

sudo ./configure --with-darwinssl
make
make install

重新启动控制台就完成了!

我遇到了这个问题,原来在https之前有一个空格,导致了这个问题。“Https://”vs“Https://”

在libcurl常见问题解答条目“libcurl不支持或禁用协议xxx”中特别提到了这一点。

为了让你开心,我在这里也嵌入了解释:

When passing on a URL to curl to use, it may respond that the particular protocol is not supported or disabled. The particular way this error message is phrased is because curl doesn't make a distinction internally of whether a particular protocol is not supported (ie never got any code added that knows how to speak that protocol) or if it was explicitly disabled. curl can be built to only support a given set of protocols, and the rest would then be disabled or not supported. Note that this error will also occur if you pass a wrongly spelled protocol part as in "htpt://example.com" or as in the less evident case if you prefix the protocol part with a space as in " http://example.com/".

这里有窗户的答案, 上面说:

curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'

哎呀,第一次尝试就已经出错了:

curl: (1) Protocol 'http not supported or disabled in libcurl

这个错误的原因有点愚蠢,Windows不喜欢你在命令中使用单引号。所以正确的命令是:

curl –XPUT "http://localhost:9200/api/twittervnext/tweet"

看起来已经有这么多答案了,但我面临的问题是双引号。 这两者之间有区别:

and

"

将第一个双引号改为第二个对我有用,下面是示例curl:

curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"