Skip to content

Instantly share code, notes, and snippets.

@jaimeiniesta
Last active March 12, 2017 16:32
Show Gist options
  • Save jaimeiniesta/f2fbc29e4da93d3a5c964226f7082185 to your computer and use it in GitHub Desktop.
Save jaimeiniesta/f2fbc29e4da93d3a5c964226f7082185 to your computer and use it in GitHub Desktop.
avro_turf issue 54 - ruby 2.2.6, rails 4.2.7.1
{
"name": "order",
"type": "record",
"fields": [
{
"name": { "type": "string" }
}
]
}
Loading development environment (Rails 4.2.7.1)
[1] pry(main)> require "avro_turf"
=> true
[2] pry(main)> avro = AvroTurf.new(schemas_path: "#{Rails.root}/app/schemas/")
=> #<AvroTurf:0x000000138eb508 @codec=nil, @namespace=nil, @schema_store=#<AvroTurf::SchemaStore:0x000000138eb490 @path="/vagrant/app/schemas/", @schemas={}>>
[3] pry(main)> avro.encode({ "name" => "jaime" }, schema_name: "order")
Avro::UnknownSchemaError: nil is not a schema we know about.
from /home/vagrant/.rvm/gems/ruby-2.2.6/gems/avro-1.8.1/lib/avro/schema.rb:89:in `real_parse'
[4] pry(main)> avro.encode({ "name" => "jaime" }, schema_name: "order")
NoMethodError: undefined method `map' for nil:NilClass
from /home/vagrant/.rvm/gems/ruby-2.2.6/gems/avro-1.8.1/lib/avro/schema.rb:247:in `to_avro'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment