I want to test my RESTful resource in Rails:
require 'rubygems'
require 'activeresource'
class Event < ActiveResource::Base
self.site = "http://localhost:3000"
end
events = Event.find(:all)
puts events.map(&:name)
I have installed gem:
gem install activeresource
But when I launch my code I get the error message:
<internal:lib/rubygems/custom_require>:29:in `require': no such file to load -- activeresource (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from service.rb:2:in `<main>'
How can I require ActiveResource?
There is a typo in your require, the following is the correct one:
require 'active_resource'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With