新手问题 尝试 Evernote API 失败

lukefan · 2012年06月17日 · 最后由 tylerlong 回复于 2012年06月20日 · 3859 次阅读

我尝试使用 evernote 的 api https://github.com/cgs/evernote gem ‘evernote’

申请了各种 key, 然后按照那个例子去做,在执行第一句的时候,就报错了:

user_store_url = "https://sandbox.evernote.com/edam/user"

config = {
   :username => 'YOUR_USERNAME',
   :password => 'YOUR_PASSWORD',
   :consumer_key => 'YOUR_CONSUMER_KEY_FROM_EVERNOTE',
   :consumer_secret => 'YOUR_CONSUMER_SECRECT_FROM_EVERNOTE'
         }

user_store = Evernote::UserStore.new(user_store_url, config)

/Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/thrift-0.8.0/lib/thrift/transport/http_client_transport.rb:47:in `initialize': can't convert nil into String (TypeError)
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/thrift-0.8.0/lib/thrift/transport/http_client_transport.rb:47:in `new'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/thrift-0.8.0/lib/thrift/transport/http_client_transport.rb:47:in `flush'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/thrift-0.8.0/lib/thrift/client.rb:41:in `send_message'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/vendor/gen-rb/evernote/edam/user_store.rb:23:in `send_checkVersion'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/vendor/gen-rb/evernote/edam/user_store.rb:18:in `checkVersion'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/thrift_client-0.8.1/lib/thrift_client/abstract_thrift_client.rb:150:in `handled_proxy'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/thrift_client-0.8.1/lib/thrift_client/abstract_thrift_client.rb:60:in `checkVersion'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/lib/evernote/client.rb:14:in `method_missing'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/lib/evernote/user_store.rb:35:in `method_missing'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/lib/evernote/user_store.rb:43:in `version_valid?'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/lib/evernote/user_store.rb:39:in `validate_version'
    from /Users/lukfan/.rvm/gems/ruby-1.9.3-p125/gems/evernote-1.2.1/lib/evernote/user_store.rb:25:in `initialize'
    from example.rb:13:in `new'
    from example.rb:13:in `<main>'

不解啊,有人玩儿过吗?有办法处理吗?

有人搞过吗?是不是版本有问题?

匿名 #2 2012年06月20日

遇到过类似问题,后来切换了版本搞定: gem "evernote", "~> 1.2.0", :git => "git://github.com/McRipper/evernote.git" gem "thrift", :git => "git://github.com/McRipper/thrift-1.9.3.git" gem "thrift_client", "~> 0.8.1", :git => "git://github.com/McRipper/thrift_client.git"

需要 登录 后方可回复, 如果你还没有账号请 注册新账号