Eurêka! #2
I was giving a try to twitter4r, a library for accessing Twitter’s API in Ruby, with Ruby installed on a Windows (Vista) box, and I was facing a the following problem:
My RoR server was crashing with “Segmentation Fault” somewhere in json/common.rb.
More specifically, it is when calling the timeline_for method that my server was blowing up.
I found the solution to this problem here, but since it is in Japanese, I thought some of you might be happy if I’d translate it in English.
In fact, it’s quite simple: the problem comes form the json library, on which twitter4r depends. If you install twitter4r with gem, as mentioned in their website, the json library is also installed, but the Win32 binaries seem buggy. The good news is there also exists a “pure ruby” implementation of json, and this one works fine. The problem is, if you install it with gem, it won’t be recognized. The solution is therefore to install both json and twitter4r manually.
How do I do that?
- For json, download
json_purepackage on RubyForge, uncompress it somewhere, move to thejson_pure-x.y.zdirectory and type the following command in a console:ruby install.rb. - As for twitter4r, download the
twitter4rpackage also on RubyForge, uncompress it somewhere, go to thetwitter4r-x.y.z\libdirectory and copy both thetwitterdirectory andtwitter.rbfile in Ruby’s library directory (type thisruby -e 'puts $:'to get the list).
Voilà!
posted in Tips | Comments Off