大家好,我是RoR的新手,有一个问题。
我正在尝试从Coinmarketcap集成API。我有一个良好的开端,但现在我遇到了证书验证失败的问题。
可以肯定的是,我对此进行了研究并发现了这个问题:RestClient::SSLCertificateNotVerified: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
但是它不能解决我的问题。
这是我的代码:
require 'rubygems'
require 'httparty'
url = 'https://api.coinmarketcap.com/v2/listings/'
response = HTTParty.get(url)
response.parsed_response
class Coinmarketcap
include HTTParty
base_uri 'api.coinmarketcap.com'
def listings
self.class.get('/v2/listings/')
end
end
coinmarketcap = Coinmarketcap.new
puts coinmarketcap.listings