TLDR; Don’t store Tweet ID’s as INT. Use BIGINT.
While writing a Twitter application in Rails I was having an issue saving tweets to the database.
A quick brief on the application: The app would download tweets from the mention timeline of a particular user. It would only download tweets it hadn’t already processed based on the last saved tweets unique id (as set by twitter). All the data from the tweets were making it into the database as expected but every time the application downloaded tweets it would re-download the same tweets.
While setting up a new Rails development environment I ran into the error bson keys must be strings or symbols. After some googling I found the following method to fix it:
/gems/bson-1.2.0/lib/bson/bson_c.rb:24:in `serialize': keys must be strings or symbols (TypeError) rvm gemset empty bundle install /fixed