Scripting RVM

While working on an issue for the highgroove-generator tool today, I came across an issue with RVM I hadn’t faced before. The tool generates a new rails project setup just how we like it and needed to create an RVM gemset and run some commands using that gemset.

I used thor to build the command line tool for the generator, which made it easy to script out the commands needed to script out the commands needed to put together the project. However, because the commands are run in a separate subshell each there are some problems with using rvm create and rvm use as I normally would to setup a gemset.

Digging into the RVM documentation, I came across an action I hadn’t seen before: rvm do. The do action lets you specify a ruby version and/or a gemset on a per command basis without having to worry about the state of the shell’s environment. So using thor, run 'gem install bundler' becomes rvm 1.9.3-p125@my_app do gem install bundler. Viola!

Checkout my commit to the generator to see rvm do in action.


So, today we enter the second half of 2012 and I figured it was a good time to review my progress on some goals I had set out for myself and add one more.

2012 Goals

In January, I set out 4 goals for myself and posted them to Facebook so that I would have some kind of accountability. I wanted all of the goals to be easily measurable and have a big impact on my life. As of the end of June I’ve made some really good progress so far:

  • I’ve bought my new house and it’s opened up a whole new neighborhood of Atlanta to me.
  • Thanks to my employer providing a personal trainer and starting to train for the Peachtree Roadrace, I’ve been working out 4 times a week on average and have lost 20 lbs. so far this year.
  • I’ve adopted a great new friend; a 3 month old border collie mix named Ernest and he’s been the highlight of my summer so far.

I’ll admit that I haven’t made much progress on my final goal of starting a business thus far, but I’ve got some big plans for the next six months. The year so far has been transformative, and I attribute that completely to setting big goals in January.

Because these goals have been a success so far, I’ve decided to add one more. For the month of July, I want to write at least 5 blog posts per week. I have wanted to work on my writing for some time now, and I have decided to bias towards getting content in front of people instead of waiting for inspiration to hit.

These will mostly relate to my professional life as a software developer and may tend to be more technical in nature. I definitely welcome any feedback or suggestions at