It appears that find_or_create_by is no longer supported by Rails 3.2.
The recommended approach for Rails 3.2 is to use first_or_create, first_or_create!, first_or_initialize methods. So changing the code from
badge_string = "kind = Kind.find_or_create_by(name: '#{args.kind}').first_or_create! \n"
to
badge_string = "kind = Kind.where(name: '#{args.kind}').first_or_create! \n"
overcomes this problem. However a note to Gioco Gem users, there seems to be a few issues with its setup scripts. Ids for points, badges, levels are not created and you will get a mass_assignment error as well. Not sure if this gem is actively supported.