scraperwiki / code-scraper-in-browser-tool

Just like on ScraperWiki Classic; now a part of QuickCode.
https://quickcode.io
Other
38 stars 8 forks source link

Ruby: uninitialized constant Twitter::REST (NameError) #139

Closed jhroy closed 9 years ago

jhroy commented 9 years ago

Hi!

I'd wrote a Ruby twitter bot and would like to use it in ScraperWiki. I'm using the 'twitter' gem written by @sferik. I require it at the start of my script.

But it returns this error: "uninitialized constant Twitter::REST (NameError)"

The script works fine when I run it locally on my Terminal. What should I do to make it work in SW?

Thanks!

PS: Here is the relevant portion of code:

require "twitter" [...] client = Twitter::REST::Client.new do |config| config.consumer_key = "MYKEY" config.consumer_secret = "MYKEY" config.access_token = "MYKEY" config.access_token_secret = "MYKEY" end

jhroy commented 9 years ago

Okay, it seems ScraperWiki is using an older version of the 'twitter' gem. The syntax is client = Twitter::Client.new do |config| instead of (in the case of the current version [5.x]) client = Twitter::REST::Client.new do |config|

Self-resolved, but I nevertheless leave this issue on the forum in case other users stumble upon it.