Created
March 12, 2017 20:56
-
-
Save mehmetaydogduu/d201c4911c71e6198f64d11a3b6cfa7b to your computer and use it in GitHub Desktop.
RestClient, Faraday, Http, Api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find the directory which ruby searches openssl | |
ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE' | |
# Download cacert.pem to that directory | |
!! The file names must be same !! | |
https://curl.haxx.se/ca/cacert.pem | |
Example for linux: | |
ruby -ropenssl -e 'puts OpenSSL::X509::DEFAULT_CERT_FILE' | |
output: /etc/ssl/cert.pem | |
cd /etc/ssl/ | |
sudo wget https://curl.haxx.se/ca/cacert.pem | |
mv cacert.pem cert.pem | |
Test it: | |
gem install rest-client | |
irb -> require 'rest-client' | |
#true | |
irb -> RestClient.get "youtube.com" | |
#Must be output like this | |
=> <RestClient::Response 200 " <!DOCTYPE..."> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment