Can't upload file to Grid FS, after uploading Logging Fails
Problems is in log method inside query.rb when Ruby Driver tries to get chunks of the file.
ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/protocol/query.rb:81:in `inspect': string contains null byte (ArgumentError)
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/protocol/query.rb:81:in `inspect'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/protocol/query.rb:81:in `inspect'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/protocol/query.rb:81:in `log_message'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/loggable.rb:123:in `log_inspect'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/loggable.rb:50:in `block in log'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/loggable.rb:49:in `each'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/loggable.rb:49:in `ensure in log'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/loggable.rb:49:in `log'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/loggable.rb:65:in `log_debug'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/server/connectable.rb:65:in `dispatch'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/operation/executable.rb:35:in `block in execute'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/server/connection_pool.rb:99:in `with_connection'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/server/context.rb:62:in `with_connection'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/operation/executable.rb:34:in `execute'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/operation/write/insert.rb:71:in `execute_write_command'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/operation/write/insert.rb:61:in `execute'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/collection.rb:191:in `insert_many'
from /Users/Artie/.rvm/gems/ruby-2.2.0/gems/mongo-2.0.2/lib/mongo/grid/fs.rb:78:in `insert_one'
from /Users/Artie/Documents/Workspace/test/mongo/file_uploader.rb:26:in `upload_with_link'
from /Users/Artie/Documents/Workspace/test/mongo/file_uploader.rb:5:in `upload'
from start.rb:11:in `<main>'