我正在尝试在Ubuntu 11.04上安装Rails环境。 当我运行命令rvm install 1.9.2 --with-openssl-dir=/usr/local
时,会收到以下错误:
curl : (1) Protocol https not supported or disabled in libcurl
如何解决这个问题?
我正在尝试在Ubuntu 11.04上安装Rails环境。 当我运行命令rvm install 1.9.2 --with-openssl-dir=/usr/local
时,会收到以下错误:
curl : (1) Protocol https not supported or disabled in libcurl
如何解决这个问题?
在Windows上得到答案在这里,它说:
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"
curl "http://localhost:3030/messages/" -H "Content-Type: application/json" --data-binary "{ \"name\":\"Curler\", \"text\": \"Hello from the command line\" }"
而不是curl "http://localhost:3030/messages/" -H "Content-Type: application/json" --data-binary '{ "name":"Curler", "text": "Hello from the command line" }'
...请注意错误部分的单引号和未转义的双引号。 - Emmanuel Mahuni我遇到了这个问题,结果发现在 https
前面有一个空格,导致了这个问题。 " https://"
与 "https://"
看起来已经有很多答案了,但我遇到的问题是双引号。 以下两者是有区别的:
“
"
把第一个双引号改成第二个,对我有用,下面是示例curl:
curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"
我在尝试为Ruby安装rvm时遇到了同样的问题。 找到了解决方案: 在root用户的下载文件夹中解压缩curl (tar)后。
cd /root/Downloads/curl # step-1
./configure --with-ssl # step-2
make # step-3
make install # step-4 (if not root, use sudo before command)
在我的情况下,libcurl一开始不支持HTTPS协议。为了找出哪些协议得到支持,哪些没有,我使用以下命令检查了curl版本:
In my case, libcurl did not support HTTPS protocol initially. To determine the supported and unsupported protocols, I used the following command to check the curl version:
curl --version
以下是提供的信息:
curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5
协议:字典文件FTP FTPS gopher http IMAP imaps LDAP LDAPS pop3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP 功能:IPv6大文件NTLM NTLM_WB SSL libz UnixSockets
注意,https协议不支持。
然后我重新安装了curl并使用以下命令进行安装(解压后):
./configure --with-darwinssl(在Mac上启用SSL通信) make make test sudo make install
经过几分钟的工作后,问题得到解决!
然后我重新运行curl版本命令,它显示:
curl 7.50.3 (x86_64-apple-darwin15.6.0) libcurl/7.50.3 SecureTransport zlib/1.2.5
协议:字典文件FTP FTPS gopher http https IMAP imaps LDAP LDAPS pop3 POP3S RTSP SMB SMBS SMTP SMTPS TELNET TFTP
功能:IPv6大文件NTLM NTLM_WB SSL libz UnixSockets
HTTPS协议出现了!
最后,当您遇到curl问题时,可以参考一个有用的网站。
https://curl.haxx.se/docs/install.html
我只需要将'http://webname...'
改为 "http://webname..."
就可以解决问题。
请注意引号。它应该是双引号 ("
),而不是单引号 ('
)。
使用 --with-darwinssl 标志解决了这个问题。
进入带有 curl 源代码的文件夹。
在此处下载:https://curl.haxx.se/download.html
sudo ./configure --with-darwinssl
make
make install
重新启动你的控制台,就完成了!
这个问题在libcurl FAQ条目 "协议 xxx 在libcurl中不被支持或禁用" 中有明确提到。
为了方便起见,我在这里嵌入了解释:
当向curl传递要使用的URL时,它可能会回复该特定协议不受支持或已禁用。这个错误消息的具体措辞是因为curl在内部没有区分特定协议是否不受支持(即从未添加任何知道如何讲述该协议的代码)还是是否明确禁用。curl可以构建为仅支持给定的一组协议,其余协议将被禁用或不受支持。
请注意,如果您传递了一个拼写错误的协议部分,例如“htpt://example.com”或在协议部分前缀加上空格的不太明显的情况,例如“http://example.com/”,也会出现此错误。
我的问题是由于UTF符号未显示引起的。我从浏览器中复制链接(在我的情况下是nginx跟踪),然后在剪贴板中得到以下内容:
$ echo -n "https://sk.ee/upload/files/ESTEID-SK_2015.pem.crt" | hexdump -C
00000000 e2 80 8b 68 74 74 70 73 3a 2f 2f 73 6b 2e 65 65 |...https://sk.ee|
00000010 2f 75 70 6c 6f 61 64 2f 66 69 6c 65 73 2f 45 53 |/upload/files/ES|
00000020 54 45 49 44 2d 53 4b 5f 32 30 31 35 2e 70 65 6d |TEID-SK_2015.pem|
00000030 2e 63 72 74 |.crt|
0xe2 0x80 0x8b
之前的地方,紧接着是https
。这个序列是一个UTF-8编码的零宽连接器。当使用curl访问https网站时,我遇到了同样的错误
curl https://api.dis...
--with-openssl-dir=/usr/local
(即仅使用rvm install 1.9.2
),会发生什么? - Omri Barelsudo apt-get install curl
)。尝试curl -o "google.html" https://google.com
来检查是否支持HTTPS。 - Omri BarelRCurl
时遇到了相同的错误信息。 - isomorphismes