开发者

cattr_accessor not working (outside rails) when active_support is required?

开发者 https://www.devze.com 2023-01-03 16:43 出处:网络
I\'m not familiar with active_support, so bear with me! Fox\'s library allows searching via google\'s APIs, but it requires active support.开发者_如何学Go i can\'t seem to get it working though! Any

I'm not familiar with active_support, so bear with me!

Fox's library allows searching via google's APIs, but it requires active support.开发者_如何学Go i can't seem to get it working though! Any ideas?

require 'rubygems'
require 'active_support'
require 'google_search'

p GoogleSearch.web :q => "Hello World!"

Gives me:

NoMethodError: undefined method ‘cattr_accessor’ for GoogleSearch:Class

Any ideas what I'm doing wrong?


With more googling I found this answer - seems to work for me!

I'm now requiring: require 'active_support/all'

I hope this helps someone!

0

精彩评论

暂无评论...
验证码 换一张
取 消