The ramblings of Eric Seijo - Software Developer / Life Hacker


Posted by Eric Seijo Wed, 26 Jun 2013 17:41:00 GMT

The lead dev for one of the high profile Rails sites I work on wanted to switch to running Rubinius. It took a bit of doing to get it set up locally for testing while keeping the main codebase untouched. Here are the steps I took to set up my dev machine (Mac OS X 10.8.4). I hope it saves someone time. (Thanks Gene for your help!)

Install Homebrew if you don't have it installed already

Then run the following:

brew install libyaml

git clone git://

cd into the rubinius directory

Once in the rubinius directory run the following to get Ruby 1.9 set as the default:

./configure --prefix= /opt/rubinius --enable-version=1.9 --default-version=1.9

sudo mkdir /opt/rubinius

sudo chown 'your account name' /opt/rubinius


rake install

export PATH=/opt/rubinius/bin:$PATH

rbx -S gem install bundler

Copy your project into another directory or create a new branch because the next steps will make changes to the project.

cd into your project directory and run:

rbx -S bundle install

rbx -S rails s

At this point your web server should be running.

Next add Puma to your Gemfile. Puma is a highspeed multithreaded server.

gem 'puma'

rbx -S bundle install

Start puma up:

rbx -S rails s puma

Have fun ;-)


Red Meat?

Posted by Eric Seijo Thu, 15 Mar 2012 13:21:00 GMT

There's been quite a debate this week over a report recently published in the Archives of Internal Medicine.

I'm still going through the report and the various opposing views (linked below) so I'll reserve my opinion for the time being and let you draw your own conclusions. This debate is of interest to me because I always struggled with the "red meat is bad" vs. "red meat is good" dilemma. Let me know what you think!

Opposing views from some of my favorite health bloggers / authors:

Steve Jobs - You live on through all of us!

Posted by Eric Seijo Thu, 06 Oct 2011 02:49:00 GMT

 Your time is limited, so don’t waste it living someone else’s life. Don’t get trapped by dogma - which is living with the results of other people’s thinking. Don’t let the noise of other’s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.” - Steve Jobs




Vaya con dios amigo!


Important and Inspiring

Posted by Eric Seijo Tue, 23 Aug 2011 15:20:00 GMT

Everyone should see the film Fat, Sick and Nearly Dead. Not only is it important globally but it can help save lives!

Here's a preview:

Ruby Haiku - List Specific Days of the Week

Posted by Eric Seijo Fri, 03 Jun 2011 16:16:00 GMT

Recently I had to populate a drop down menu with the dates of every Sunday for the year up to the present day.

Ruby makes this so freaking easy:

start_date =, month=1, date=1)
end_date =
my_array = (start_date..end_date).select { |p| [0, 6].include? p.wday }

( Ruby == <3 ) 

Happy coding!

Why Ruby On Rails is Hot

Posted by Eric Seijo Thu, 12 May 2011 15:34:00 GMT

Business Insider just published a great article on why Ruby On Rails is rapidly becoming the preferred framework for web development. 

I certainly love it!



The Paleo Diet

Posted by Eric Seijo Mon, 11 Oct 2010 17:56:00 GMT

I've been researching diet and nutrition for quite some time now. It's a subject that (for some reason) really interests me. Maybe it's because I abused my body so much in my teens and twenties or maybe it's something that naturally happens when you get older, dunno... But my longterm plan is to run marathons and complete in triathlons and a big part of achieving this is with good nutrition.

People that know me know that as a voracious reader I am always reading diet and nutrition books, from Eat to Live to The China Study to The Engine 2 Diet (all very informative and highly workable lifestyles). Over the weekend I read a blog post by Tim Ferris on his blog which got me thinking about the Paleo Diet (a diet which is based on the diet of our Paleolithic ancestors). It's a great article and worth the read. 

I started researching on Google and found which has a wealth of information from Dr. Cordian one of the leading experts on the diet.  I'm going to pickup some books and see where this takes me but meanwhile I plan on starting with a basic meal plan.

Here's a quick video by the author of The Paleo Solution.




Have Fun!

Do Schools Kill Creativity?

Posted by Eric Seijo Mon, 28 Jun 2010 13:21:00 GMT

 I just watched "Do Schools Kill Creativity?" by Sir Ken Robinson author of the great book The Element. It is from a TED talk and is absolutely brilliant and a much watch!




Apple and Flash - Jobs sets the record straight

Posted by Eric Seijo Thu, 29 Apr 2010 14:10:00 GMT

Although I am of mixed feelings on Apple's decision not to allow developers to use 3rd party development environments this article by Steve Jobs makes a lot of sense to me. I wonder if I would do the same thing...



Ruby Haiku - Sorting an Array of Hashes

Posted by Eric Seijo Wed, 24 Feb 2010 15:38:00 GMT

 I'm constantly amazed at how easy it is to do (seemingly) complex tasks in Ruby.  I was recently faced with having to manipulate a large dataset for a report and give the user the ability to sort the data. Rather than deal with multiple queries to the database I queried once, grabbed what I needed and proceeded to manipulate the data and shove it in a data structure for use in display.  This being a Ruby on Rails site, I chose a Ruby array of hashes as the data structure.  


user_billing = [{:name=>"Eric", :location=>"Florida", :billing =>10000}, {:name=>"Adam", :location=>"North Carolina", :billing =>5000}]

Sort it based on name:

user_billing.sort_by { |billing| billing[:name] }


[{:billing=>5000, :location=>"North Carolina", :name=>"Adam"}, {:billing=>10000, :location=>"Florida", :name=>"Eric"}]

Now we can put it in a block:

user_billing.sort_by { |billing| billing[:name] }.each do |billing|
  puts "#{billing[:name]}, #{billing[:location]}, #{billing[:billing]}"


Adam, North Carolina, 5000
Eric, Florida, 10000

Pretty cool and so simple.

Happy coding!


Installing Refinery CMS on Heroku

Posted by Eric Seijo Wed, 02 Dec 2009 04:16:00 GMT

I've been using Refinery CMS on some client projects and am really enjoying working with it. Every aspect of the CMS is able to be overridden and customized.

Recently I've been using Heroku as a host for my Ruby on Rails applications and let me just say that they ROCK!  The customer service is great, the performance is awesome and as of this writing they have over 40,000 apps running. There are some constraints to their service however, the biggest for me is the read only filesystem. This is easily to overcome using Amazon S3 but you have to get your clients to sign up for it first and or use your own account.

Here are the steps I take to get everything setup and working.  Most of these steps are taken from Ryan Wood's great post. I highly recommend reading it.

Setup Amazon S3:

Get set up with Amazon S3 and create a bucket for your project.

Configure the config/amazon_s3.yml file and include your bucket name, access key and secret key as follows:

production: bucket_name:

Override Refinery Code:

Override Refinery plugin code so that future framework updates do not break your Heroku configuration.  You have to do this because of the read only filesystem.

Run the following:

mkdir -p app/models
cp vendor/plugins/images/app/models/image.rb app/models
cp vendor/plugins/inquiries/app/models/inquiry.rb app/models
cp vendor/plugins/news/app/models/news_item.rb app/models
cp vendor/plugins/pages/app/models/page.rb app/models
cp vendor/plugins/resources/app/models/resource.rb app/models  


Override Images and Resources to use S3: 

Change the has_attachment section in app/models/image.rb to this:

has_attachment :content_type => :image,
                               :storage => :s3,
                               :processor => 'Rmagick',
                               :thumbnails => ((RefinerySetting.find_or_set(:image_thumbnails, rescue,
                               :max_size => 5.megabytes


 Change the has_attachment section in app/models/image.rb to this:

  has_attachment  :storage => :s3,
                              :size => 0.kilobytes..50.megabytes

Update the search index location options adding in the following key pair to the hash: 


:index_file => [RAILS_ROOT,"tmp","index"]

You will need to add this to each file in app/models for example in app/models/image.rb it should look like this:


acts_as_indexed :fields => [:title], :index_file => [RAILS_ROOT,"tmp","index"] 


Create a .gems file:

Create a .gems file in the root directory. This file is required by Heroku in order to install gems which your application needs that are not installed on their servers already.

Add the following to the .gems file:



Heroku Setup:

For details checkout Heroku's great documentation.

Make sure you have the Heroku gem installed on your system and you have an account set up. More info here.

Make sure you have git installed on your system and a git repository set up for your Refinery CMS project.

To initialize git run:

$ git init


Create your application on Heroku:

$ heroku create 


Push your application to Heroku:

$ git push heroku master


Create your Refinery CMS database schema on Heroku:

$ heroku rake db:schema:load


Run any migrations:

$ heroku rake db:migrate 


 Seed the database:

$ heroku rake db:seed


Go to your created site on Heroku and get started!



Posted by Eric Seijo Thu, 01 Oct 2009 16:11:00 GMT

I pretty much only use Pandora for listening to music these days since I subscribed to the Pandoa One service. The flexibility and exposure to new music is awesome. I wonder who will try to buy them first, Google, Apple or Microsoft? Seems like apple would have the most to gain or loose depending on how you look at it.  Wouldn't they want me streaming music from within iTunes?

Google Chrome Frame

Posted by Eric Seijo Thu, 24 Sep 2009 13:19:00 GMT

I'm very excited about the release of Google's new open source project Google Chrome Frame.  Google Chrome Frame enable open web technologies in Internet Explorer. It is an open source plug-in that seamlessly brings Google Chrome's open web technologies and JavaScript engine to Internet Explorer. With Google Chrome Frame, you can:

  • Start using open web technologies - like the HTML5 canvas tag - right away, even technologies that aren't yet supported in Internet Explorer 6, 7, or 8.
  • Take advantage of JavaScript performance improvements to make your apps faster and more responsive.

I think all web developers should make a concerted effort to push adoption of the Chrome Frame plugin. I'm excited to be able to create a web standards version of a site and not have to worry about how it looks in earlier versions of IE.




Snow Leopard - MySQL Upgrade

Posted by Eric Seijo Tue, 01 Sep 2009 20:34:00 GMT

I just upgraded my main production Mac to Snow Leopard and when I sat down to work today I noticed that I was unable to access the local MySQL instance. After doing some research I found that it is probably best to seize the moment and upgrade to the 64bit version.

There were some tricky things I encountered along the way so I thought I would share in hopes of making someone else's life easier.

  1. Before you upgrade backup any of your databases:

    mysqldump -u username -ppassword database_name > dump.sql

    Or, if you want to backup all databases use:

    mysqldump -u username -ppassword –all-databases > dump.sql

  2. Run the Snow Leopard install.

  3. Download and install the 64-bit MySQL 5.1.37 from

  4. For Ruby on Rails run the following commands to update your gems:

    sudo gem update --system

    sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

  5. Import your data:

    mysql -u username -ppassword database_name < dump.sql

  6. Update MacPorts if needed.

  7. Update your gems.

You should be up and running.



Behaviour-Driven Development

Posted by Eric Seijo Fri, 24 Jul 2009 03:52:00 GMT

I recently jumped on the Behaviour-Driven Development bandwagon as It's kind of the way I always felt the software development process should be. I found my way to it through the Ruby on Rails and the Agile software communities.

I recently watched a great talk by Dan North titled Behaviour-Driven Development - a road to effective design and clean code. Dan is a very entertaining speaker and I recommend this talk to anyone interested in BDD.

Google Chrome OS

Posted by Eric Seijo Thu, 09 Jul 2009 14:07:00 GMT

Looks like Google is finally moving into the OS space. I could see it coming and to tell you the truth I think it is good for the industry. Google Chrome is built on top of Linux and applications will be web based.

As a web developer I'm excited to see that Google continues to push towards web based / cloud based apps and services.

Here's a Google's blog post announcing it.

There are also potentially some issues with Google's CEO Eric Schmidt being on Apple's board now that Google is in the OS business. Wonder how that will turn out? I don't think I would want a competitor's CEO on my board... Here's a link to the story.

Developers - Be Nice To The Next Guy

Posted by Eric Seijo Wed, 17 Jun 2009 15:53:00 GMT

I have spent the last few weeks adding functionality and making changes to a legacy enterprise application. I ran across some situations that I had to workaround which prompted me to make this list of what I consider basic and standard procedure:
  1. Comment Your Code - I can't tell you how frustrating it is to spend an hour reading through hundreds of lines of spagetti code looking to find out what a specific object or variable does. Although I mostly get paid by the hour, I'd rather solve the problem and spend my time making improvements to the code base and the application. If some bit of code isn't self-explanatory then please take 30 seconds and write a comment.
  2. Name Objects and Variables Expressively - Although it is often a matter of semantics I find it not only good coding practice but good manners to name things appropriately. I can't count how many times I've run across a variable called "var1" or an object named "obj3" or a method named "myVarCon". WTF do these mean? What do they do?? One of the great things I've learned as a Ruby programmer is to express yourself and your intentions within your code. If you have a variable like number_of_hours_worked or a method named convert_us_currency_to_british_pounds they speak for themselves and clarify your intentions. Naming in this way can get a bit verbose but I really think it's worth it, if not for the developer writing the code, then for those that follow.
  3. Document Your Work - The Ruby on Rails framework has a great documentation system baked right in to the framework which makes this very easy. If you're working on an app in a framework that doesn't offer documentation you should still take the the time to document your work. In these instances I like to provide at the very least a README for each major section of the app so that developers that follow have some help getting up to speed on the application and code structure.

    For example, I just spent a day looking for a discrepancy in an enterprise payroll application where various employee's pay were randomly getting reported incorrectly. The pay was correct but the reporting after the fact wasn't. This company has 700+ employees spread over 16 offices and there were thousands of lines of uncommented spaghetti code to read through (see the previous two items on my list) and track values across. After a day of this all of the code seemed to do what it was supposed to but no solution or bug was found. I was talking through this with one of my developers and he mentioned that while running queries against the database ever time he ran an update query the value in question never changed. A light bulb went off and I said to him, TRIGGERS! Sure enough there was an update trigger on the table which (to say the least) set a pay percentage value back to a "default" value for an office location. This "default" value was something that was used years ago and had since changed. The problem was that none of us knew about it. Now, after experiencing this I have changed my standard practice when learning a legacy system to include studying and documenting each and every table in the RDBMS.
I've worked with and come after some great developers which have made the transition to learning a new project so much more productive and fun. Let's all think about and be nice to the next guy!

Inbox Zero 1

Posted by Eric Seijo Fri, 05 Jun 2009 03:24:00 GMT

I've known about the Inbox Zero concept for a while now and I have applied many of the ideas from Getting Things Done to my life but still could not stay ahead of the curve with regards to my email. I have 9 email accounts that I check which amounts to quite a bit of traffic...

I recently switched all of my accounts to point to my mail Gmail account, watched the Inbox Zero video again and started applying it with a vengeance - labeling and archiving as much as possible etc.. I'm having great success with it personally and highly recommend you look into it.

Here's the video given by Merlin Mann at a Google Tech Talk:


Google Wave A New Web Platform

Posted by Eric Seijo Fri, 29 May 2009 20:53:00 GMT

I just watched the new screencast from Google I/O about Google Wave. The Wave team is doing some amazing things with JavaScript and HTML5. I can't wait to try it out! Here's the preview screencast on YouTube:



Filesystem Error

Posted by Eric Seijo Fri, 29 May 2009 03:41:00 GMT

I had an interesting thing happen tonight while deploying a new version of a site to staging. After deploy I navigated to the site and got an Application Error Rails application failed to start properly.

I ssh'd in to the site and ran some commands and got the following error:

WARNING: #<Errno::ESTALE: Stale NFS file handle - /usr/lib/ruby/gems/1.8/specifications/rack-1.0.0.gemspec>

WARNING: Invalid .gemspec format in '/usr/lib/ruby/gems/1.8/specifications/rack-1.0.0.gemspec'


There are various references on google with regards to the linux Stale NFS file handle. As the error suggests the filesystem got hosed and needed to be remounted and the apache service had to be reconfigured.

Once this was done I was back in business.


New Blog

Posted by Eric Seijo Thu, 28 May 2009 07:15:00 GMT

I finally got my blog online, it's been a long time coming. As a Ruby on Rails developer I really wanted to use a rails powered blog and not just use Wordpress. Wordpress is cool and I've set many a site up for clients but I had heard good things and bad things about Typo and wanted to try it out for myself.

I actually like Typo, it's pretty simple and I was able to thoroughly tweak the source to suit my needs. I'm sure I'll be tweaking more. I also created a quick design and easily turned it into a theme which was pretty easy to do. I'll have to ask some of my designer friends to create me a nice one soon.

I ran into some gotchas while configuring Typo with Dreamhost which I'll post about soon.

Hello World!

Posted by Eric Seijo Thu, 28 May 2009 06:50:00 GMT

First post. It’s a-blog time!