user4652667
user4652667

Reputation:

RestClient throws some error in Ruby

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

Answers (1)

Agustin Cornu
Agustin Cornu

Reputation: 196

Make sure you are using the 'rest-client' gem and not 'restclient'.

Upvotes: 1

Related Questions