Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Twitter.user("peter_v").location fails with multi_json error on ruby 1.8.7
RESOLVED:
The problem was that a JSON parser needs to be provided.
RTFM ...
https://github.com/jnunemaker/twitter#readme
says:
Help! I'm getting: "Did not recognize your engine specification.
Please specify either a symbol or a class. (RuntimeError)"
If you're using the JSON request format (i.e., the default),
you'll need to explicitly require a JSON library. We recommend yajl-ruby.
So the resolution then becomes:
$ rvm use 1.8.7@t
$ gem install twitter yajl-ruby
$ ruby -e'require "twitter";require"yajl";puts Twitter.user("peter_v").location'
RESOLVED
On 1.8.7 p330 FAIL
==================
peterv@ASUS:~/ru$ rvm gemset create twitter
'twitter' gemset created (/home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter).
peterv@ASUS:~/ru$ rvm use 1.8.7@twitter
Using /home/peterv/.rvm/gems/ruby-1.8.7-p330 with gemset twitter
peterv@ASUS:~/ru$ gem list
*** LOCAL GEMS ***
rake (0.8.7)
peterv@ASUS:~/ru$ gem install twitter # (no ri no rdoc)
********************************************************************************
Follow @gem on Twitter for announcements, updates, and news.
https://twitter.com/gem
Join the mailing list!
https://groups.google.com/group/ruby-twitter-gem
Add your project or organization to the apps wiki!
https://github.com/jnunemaker/twitter/wiki/apps
********************************************************************************
Successfully installed hashie-1.0.0
Successfully installed addressable-2.2.4
Successfully installed multipart-post-1.1.0
Successfully installed rack-1.2.1
Successfully installed faraday-0.5.5
Successfully installed faraday_middleware-0.3.2
Successfully installed multi_json-0.0.5
Successfully installed multi_xml-0.2.1
Successfully installed simple_oauth-0.1.4
Successfully installed twitter-1.1.2
10 gems installed
peterv@ASUS:~/ru$ irb
001:0> require 'twitter'
=> true
002:0> Twitter.user("peter_v").location
MultiJson::DecodeError: #<RuntimeError: Did not recognize your engine specification. Please specify either a symbol or a class.>
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/multi_json-0.0.5/lib/multi_json.rb:66:in `decode'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday_middleware-0.3.2/lib/faraday/parse_json.rb:22:in `register_on_complete'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/response.rb:45:in `call'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/response.rb:45:in `finish'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/response.rb:45:in `each'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/response.rb:45:in `finish'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/builder.rb:18:in `inner_app'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/response.rb:17:in `call'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/response.rb:17:in `call'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/adapter/net_http.rb:57:in `call'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/faraday/multipart.rb:16:in `call'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/request.rb:84:in `run'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/request.rb:26:in `run'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/connection.rb:171:in `run_request'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/faraday-0.5.5/lib/faraday/connection.rb:64:in `get'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/twitter/request.rb:28:in `send'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/twitter/request.rb:28:in `request'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/twitter/request.rb:6:in `get'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/twitter/client/user.rb:23:in `user'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/twitter.rb:21:in `send'
from /home/peterv/.rvm/gems/ruby-1.8.7-p330@twitter/gems/twitter-1.1.2/lib/twitter.rb:21:in `method_missing'
from (irb):2003:0> MultiJson
=> MultiJson
004:0> puts RUBY_VERSION
1.8.7
=> nil
005:0> puts RUBY_PATCHLEVEL
330
=> nil
On 1.9.2 PASS
=============
peterv@ASUS:~/ru$ rvm gemset create twitter
'twitter' gemset created (/home/peterv/.rvm/gems/ruby-1.9.2-p136@twitter).
peterv@ASUS:~/ru$ rvm use 1.9.2@twitter
Using /home/peterv/.rvm/gems/ruby-1.9.2-p136 with gemset twitter
peterv@ASUS:~/ru$ gem list
*** LOCAL GEMS ***
rake (0.8.7)
peterv@ASUS:~/ru$ gem install twitter
********************************************************************************
Follow @gem on Twitter for announcements, updates, and news.
https://twitter.com/gem
Join the mailing list!
https://groups.google.com/group/ruby-twitter-gem
Add your project or organization to the apps wiki!
https://github.com/jnunemaker/twitter/wiki/apps
********************************************************************************
Successfully installed hashie-1.0.0
Successfully installed addressable-2.2.4
Successfully installed multipart-post-1.1.0
Successfully installed rack-1.2.1
Successfully installed faraday-0.5.5
Successfully installed faraday_middleware-0.3.2
Successfully installed multi_json-0.0.5
Successfully installed multi_xml-0.2.1
Successfully installed simple_oauth-0.1.4
Successfully installed twitter-1.1.2
10 gems installed
peterv@ASUS:~/ru$ irb
001:0> require 'twitter'
=> true
002:0> Twitter.user("peter_v").location
=> "Flanders"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.