0

I'm trying to run a simple Foursquare auth in Ruby with Sinatra. I am using the example here.

When I try to run this code on my local server, I get this error

 NoMethodError at /
undefined method `web_server' for #<OAuth2::Client:0x16168bc>

I can't figure out how to fix this... Ideas?

Slicekick
  • 2,119
  • 5
  • 24
  • 35

1 Answers1

0

the web_server method was removed in v0.5.0 of the OAuth2 ruby gem.

install a prior version of the gem to make use of the missing method:

gem install oauth2 -v 0.4.1

and modify your script by adding the following line before the require 'oauth2' so it will only accept that particular version of the gem:

gem 'oauth2', '=0.4.1'

edit: looks like the example hasn't been updated for a while -- I forked it and included the above suggested workaround (which has since been merged into the original repository).

wehal3001
  • 761
  • 5
  • 12