I was trying to write a fluentd plugin which required to install avro library. Initially I did not realize that fluentd uses it’s internal ruby and gems.
I tried installing avro through the system gem and brought up fluentd td-agent, this gave an error like:
abishek@abishek-VirtualBox:~$ sudo /etc/init.d/td-agent start
* Starting td-agent td-agent /usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require’: cannot load such file — avro (LoadError)
Solution was to use fluentd gem to install the required libraries:
1. Installed multi_json as it’s a dependency for avro. Note avro library complains for multi-json, but the actual lib name is multi_json.
abishek@abishek-VirtualBox:/usr/lib/fluent/ruby/bin$ sudo ./gem install ‘multi_json’
2. Due to the multi-json/multi_json bug, avro >1.7.6 does not work. Need to install a lower version.
abishek@abishek-VirtualBox:/usr/lib/fluent/ruby/bin$ sudo ./gem install avro -v 1.7.5
I could verify the gems under fluentd’s gems directory: /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems