1

I am trying to take the Evernote Ruby example https://github.com/evernote/evernote-sdk-ruby which uses Sinatra and integrate it into Rails.

I have everything working fine until pulling a list of notebooks in the callback.

notebooks = noteStore.listNotebooks(access_token.token)
result = Array.new
notebooks.each do |notebook| 
  result << notebook.name
end
@notebooks = result

It's getting this error: (which isn't helpful at all)

RuntimeError in CallbacksController#callback

--- !binary |-
U1NMX2Nvbm5lY3QgcmV0dXJuZWQ9MSBlcnJubz0wIHN0YXRlPVNTTHYzIHJl
YWQgc2VydmVyIGNlcnRpZmljYXRlIEI6IGNlcnRpZmljYXRlIHZlcmlmeSBm
YWlsZWQ=

The Sinatra app works correctly. So my guess is that some file is not being loaded to parse this. But I have tried everything.

I will post the full controller here: http://paste.codebasehq.com/pastes/7frtcdhyncwb0emznj

Thanks for the help.

Eric Goodenough
  • 141
  • 3
  • 12

1 Answers1

2

I guess to_yml makes your error message unreadable like:

--- !binary |-
U1NMX2Nvbm5lY3QgcmV0dXJuZWQ9MSBlcnJubz0wIHN0YXRlPVNTTHYzIHJl
YWQgc2VydmVyIGNlcnRpZmljYXRlIEI6IGNlcnRpZmljYXRlIHZlcmlmeSBm
YWlsZWQ=

Can you replace to_yml with inspect? It seems simply your message is outputted as binary and you could figure out the cause of error from messages if it is outputted as text.

Related post: Thor & YAML outputting as binary?

Community
  • 1
  • 1
kentaro
  • 1,249
  • 2
  • 13
  • 19