I get the error: NameError (uninitialized constant SnowplowTracker::SelfDescribingJson): When I try to initialize a Self describing JSON in ruby. Heres some example code that fails:
require 'snowplow-tracker'
require 'contracts'
require 'webmock'
e = SnowplowTracker::Emitter.new('com.acme')
t = SnowplowTracker::Tracker.new(e)
t.track_self_describing_event(SnowplowTracker::SelfDescribingJson.new(
"iglu:com.example_company/save_game/jsonschema/1-0-2",
{
"saveId" => "4321",
"level" => 23,
"difficultyLevel" => "HARD",
"dlContent" => true
}
))
Strangly Emitter and Tracker will not throw an error. Heres some more context:
- Using Ruby 2.5.5
- gemfile contains all of the requirements and is bundled
I solved this. in my gemfile I had:
should have been:
If you get this error check what version's are available here: https://rubygems.org/gems/snowplow-tracker/versions/0.6.1
The tracker also depended on an older version of contracts but
bundle
told me what one to use.