Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails curl:(1)libcurl中不支持或禁用协议https_Ruby On Rails_Curl_Openssl_Libcurl_Ubuntu 11.04 - Fatal编程技术网

Ruby on rails curl:(1)libcurl中不支持或禁用协议https

Ruby on rails curl:(1)libcurl中不支持或禁用协议https,ruby-on-rails,curl,openssl,libcurl,ubuntu-11.04,Ruby On Rails,Curl,Openssl,Libcurl,Ubuntu 11.04,我正在尝试在Ubuntu11.04上安装Rails环境。当我启动命令rvm install 1.9.2--with openssl dir=/usr/local时,收到以下错误: curl : (1) Protocol https not supported or disabled in libcurl 如何解决这个问题?libcurl常见问题解答条目“”中特别提到了这一点 出于您的高兴,我也将解释嵌入此处: 当传递URL以供curl使用时,它可能会响应 不支持或禁用特定协议。特殊方式 此错误

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

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

如何解决这个问题?

libcurl常见问题解答条目“”中特别提到了这一点

出于您的高兴,我也将解释嵌入此处:

当传递URL以供curl使用时,它可能会响应 不支持或禁用特定协议。特殊方式 此错误消息的措辞是因为curl不会产生错误 区分某一特定协议是否有效 支持(即从未添加任何知道如何表达的代码) 协议)或如果它被显式禁用。curl只能构建为 支持一组给定的协议,其余的将被禁用 或不受支持

请注意,如果传递拼写错误的 “中的协议部分”htpt://example.com“或者像不太明显的 如果在协议部分前面加上空格,则为“ “


我在尝试为ruby安装rvm时遇到了同样的问题。 找到解决方案: 在根目录的下载文件夹中提取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)
得到了windows的答案, 上面说:

curl -XPUT 'http://localhost:9200/api/twittervnext/tweet'
Woops,首先尝试,但已出现错误:

curl: (1) Protocol 'http not supported or disabled in libcurl
出现此错误的原因有点愚蠢,Windows不喜欢在命令中使用单引号。因此,正确的命令是:

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

我遇到了这个问题,结果发现在
https
之前有一个空格导致了这个问题
“https://”vs
“https://”

在https站点上使用curl时遇到相同的错误,如

curl https://api.dis...

正如所指出的,这是因为我的curl版本没有启用ssl。返回并下载了带有ssl的版本,它运行良好。

我只需更改
”即可解决此问题http://webname...“
”http://webname...“


请注意引号。它应该是双引号(
)而不是单引号(
).

我刚刚用指向openssl 1.0.2g库文件夹和include文件夹的配置选项重新编译了curl,我仍然收到了这条消息。当我对curl进行ldd时,它没有显示它使用了
libcrypt.so
libssl.so
,因此我认为这一定意味着即使
make
make install
成功,无错误,但curl不支持HTTPS?配置和制作如下:

./configure --prefix=/local/scratch/PACKAGES/local --with-ssl=/local/scratch/PACKAGES/local/openssl/openssl-1.0.2g --includedir=/local/scratch/PACKAGES/local/include/openssl/openssl-1.0.2g
make
make test
make install

我应该提到
libssl.so.1
/local/scratch/PACKAGES/local/lib
中。现在还不清楚
--with ssl
选项应该指向那里还是指向openssl安装放置openssl.cnf文件的目录。我选择了后者。但是如果它应该是前者,make应该失败错误是找不到库。

用flag解决了这个问题——用darwinssl

转到包含curl源代码的文件夹

在这里下载


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

在我的情况下,libcurl首先不支持HTTPS协议。要了解哪些协议受支持,哪些不受支持,我使用以下命令检查了curl版本:

curl --version
它提供的资料如下:
curl 7.50.3(x86_64-apple-darwin15.6.0)libcurl/7.50.3安全传输zlib/1.2.5
协议:dict文件ftp ftps gopher http imap imaps ldap ldaps pop3 pop3 rtsp smb smb smtp smtps telnet tftp 特点:IPv6大文件NTLM NTLM_WB SSL libz UnixSockets

其中https协议恰好不受支持

然后我重新安装了curl,并使用以下命令(解包后)安装了它:

./configure--使用darwinssl(在mac中启用ssl通信) 制作 测验 sudo制作安装

经过几分钟的工作,问题解决了

然后我重新运行curl version命令,它显示:

curl 7.50.3(x86_64-apple-darwin15.6.0)libcurl/7.50.3安全传输zlib/1.2.5
协议:dict文件ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3 rtsp smb smb smtp smtps telnet tftp 特点:IPv6大文件NTLM NTLM_WB SSL libz UnixSockets

HTTPS协议出现了

最后,当您遇到卷曲问题时,可以参考一个有用的站点。
https://curl.haxx.se/docs/install.html

在url中指定协议可能会解决您的问题

我有一个类似的问题(在使用curl-php客户端时):

我是通过domain.com而不是sftp://domain.com 这导致了这个令人困惑的错误:

libcurl中不支持或禁用协议“http”,耗时0秒


我的问题是由于未显示UTF符号造成的。我从浏览器复制了链接(在我的情况下是一个),并在剪贴板中获得以下内容:

$ 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:

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

我也遇到了这个问题,在调试后找到了罪魁祸首。在我的例子中,它是https前面的“空格”字符

如果不使用openssl dir=/usr/local
(即简单地
rvm安装1.9.2
),会发生什么?同样的问题,我认为…是一个解决方法。我发现很难相信您的curl不支持HTTPS。可能是rvm自带了curl,或者您没有安装curl(
sudo apt get install curl
)。请尝试
curl-o“google.html" https://google.com
以检查是否支持HTTPS。我有
"
curl -X PUT -u xxx:xxx -T test.txt "https://test.com/test/test.txt"