Reputation:
My code throws an error but I don't know why that error occurs
require 'rest_client'
response = RestClient.get 'http://example.com/resource'
puts response.code
Output:
i.rb:3:in `<main>': uninitialized constant RestClient (NameError)
Upvotes: 1
Views: 1100
Reputation: 196
Make sure you are using the 'rest-client' gem and not 'restclient'.
Upvotes: 1