Giu*_*ico 121 curl openssl ruby-on-rails libcurl ubuntu-11.04
我正在尝试在Ubuntu 11.04上安装Rails环境.当我启动命令时rvm install 1.9.2 --with-openssl-dir=/usr/local
,收到以下错误:
curl : (1) Protocol https not supported or disabled in libcurl
Run Code Online (Sandbox Code Playgroud)
怎么解决这个问题?
cnl*_*evy 229
得到的回答这里的窗户,它说那里:
curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'
Run Code Online (Sandbox Code Playgroud)
Woops,首先尝试并且已经出错了:
curl: (1) Protocol 'http not supported or disabled in libcurl
Run Code Online (Sandbox Code Playgroud)
出现此错误的原因有点愚蠢,当您使用命令的单引号时,Windows不喜欢它.所以正确的命令是:
curl –XPUT "http://localhost:9200/api/twittervnext/tweet"
Run Code Online (Sandbox Code Playgroud)
jbr*_*ahy 70
我遇到了这个问题,结果发现https
在导致问题之前有一个空格." https://"
VS"https://"
Pav*_*Obj 12
看起来已经有很多答案了,但是我遇到的问题是双引号。两者之间有区别:
“
Run Code Online (Sandbox Code Playgroud)
和
"
Run Code Online (Sandbox Code Playgroud)
将第一个双引号更改为第二个对我有用,下面是示例curl:
curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"
Run Code Online (Sandbox Code Playgroud)
R T*_*R T 10
我在尝试为ruby安装rvm时遇到了同样的问题.找到解决方案:在root的downloads文件夹中解压缩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)
Run Code Online (Sandbox Code Playgroud)
这在libcurl FAQ条目"libcurl中不支持或禁用协议xxx "中特别提到.
为了您的荣幸,我也在这里嵌入了解释:
传递要使用的curl的URL时,它可能会响应不支持或禁用特定协议.这个错误消息的特殊表达方式是因为curl不会在内部区分是否不支持特定协议(即从未获得任何知道如何说该协议的代码)或者是否明确禁用了该协议.curl可以构建为仅支持给定的一组协议,其余的将被禁用或不受支持.
请注意,如果您在"htpt://example.com"中传递错误拼写的协议部分,或者在不太明显的情况下,如果您在协议部分前面添加空格,则会出现此错误,如" http:// example "中 所示.com / ".
用标志--with-darwinssl解决了这个问题
转到带有curl源代码的文件夹
在此处下载https://curl.haxx.se/download.html
sudo ./configure --with-darwinssl
make
make install
Run Code Online (Sandbox Code Playgroud)
重新启动你的控制台,它就完成了!
就我而言,libcurl首先不支持HTTPS协议.为了找出支持哪些协议以及哪些协议不支持,我使用命令检查了curl版本:
卷曲 - 翻译
它提供的信息如下:curl 7.50.3(x86_64-apple-darwin15.6.0)libcurl/7.50.3 SecureTransport zlib/1.2.5协议:dict文件ftp ftps gopher http imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp功能:IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
其中https协议恰好不受支持.
然后我重新安装curl并使用以下命令安装它(解压后):
./configure --with-darwinssl(在mac中启用ssl通信)
使
做测试
sudo make install
经过几分钟的工作,问题解决了!
然后我重新运行curl版本命令,它显示:
curl 7.50.3(x86_64-apple-darwin15.6.0)libcurl/7.50.3 SecureTransport zlib/1.2.5协议:dict文件ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp功能:IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets
HTTPS协议出现了!
最后,当您遇到卷曲问题时,这是一个有用的网站. https://curl.haxx.se/docs/install.html