rubyrspecfaraday

RuntimeError: :json is not registered on Faraday::Request


I am fairly new to ruby and I am trying to execute a spec and I receive this error:

RuntimeError:
          :json is not registered on Faraday::Request

I am trying to use this gem: https://github.com/Chicago/windy

Mac OS X 10.7.4 Ruby 1.9.3, using RVM


Solution

  • I've just run into this when upgrading Faraday. The json request middleware was removed from Faraday in 0.8. It is now in the faraday_middleware gem. You should gem install faraday_middleware and require it in the file that creates the Faraday object.

    See https://github.com/lostisland/faraday_middleware/wiki/Changes-0.8