Reputation: 63
require 'rubygems'
require 'httparty'
class myClass
include HTTParty
base_uri 'https://jsonplaceholder.typicode.com'
def posts
self.class.get('/users')
end
end
Upvotes: 0
Views: 525
Reputation: 63
So, I got this error. And the simplest solution to this is as below.
Download cacert.pem file from this link http://curl.haxx.se/ca/cacert.pem
So, I have installed my Ruby in D drive inside Railsinstaller folder likewise, "D:\RailsInstaller\Ruby2.3.3\lib\ruby\2.3.0\rubygems\ssl_certs" go to the directory where you have install ruby and got to this path "Ruby2.3.3\lib\ruby\2.3.0\rubygems\ssl_certs inside this save the cacert.pem file, make sure it is .pem file.
Now, go to the environment.rb file in your rails application and save as below: ENV['SSL_CERT_FILE'] = "/your/file/path/cacert.pem"
and DONE!
Upvotes: 1