Today I was trying to generate a Rails 3.1.0 project (for testing purposes). I simply called rails new rollback which generated a rails 3.2.11 project and proceeded to change the gemfile version to 3.1.0. This resulted in numerous application errors. The simple solution was to generate the project with the Rails version 3.1.0. To do this call the gem with the version number as such: $ rails _3.1.0_ new rollback You also must already have this version of the gem installed on your system for it to work.

Continue reading

While working with my new employer (in 2011) I noticed a minor but recurring issue in our application. We had been storing flash[:notice] messages in most of our actions but were not using that flash message anywhere. This was resulting in the flash message showing up at in-appropriate times. What I was unaware of was a slightly different call which is flash.now[:notice]. This results in the flash only having a lifespan of the through the next request.

Continue reading

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.

Continue reading

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

Continue reading

Author's picture

Brian Pearce

Software Developer, Endurance Cyclist,
Rubiest, and Rustacean

Software Engineer

Barcelona, Spain