Goodbye Bend

Goodbye Bend, Hello Portland!

My wife and I have lived in Bend for nine years, last month we spent our last weekend there together and just spent my last few days in Bend working on Ruby on Ales 2012. When siting here reflecting on all that's happened in that span of time it's hard to not smile about all that we've done. The year 2003 feels so close yet it was nearly a decade ago...

Everything we counted as part of our lives was in or near Bend, yet it never felt like "home" for us. Even with the lack of the "home" attachment, It's hard to leave a town that you've spent so much time in. From knowing which store has the best vegan cookies to the preferred teller at our bank, we knew everything about that town. My daughter even named her favorite parts. We had the "boat" park and the "pirate" park and she named our house the "brown house". She knew where her favorite toy-store was and how long it would take to get there.

I've been involved in the tech scene on Bend since Jeran and I arrived. From the original Bend Linux/Unix Users Group founding in 03 to the most recent Ruby on Ales conference just this week I've always been a giant supporter of local tech initiatives and groups. One of the things I'm most passionate about is making sure we as technologists have close ties to others with same interests in our communities. Twitter and Facebook make that easier today, but there is nothing like a quick chat and a beer to keep a group of hackers together.

I'll miss these groups the most:
Hack Night Bend
BendUG
COWPU
COISUG

Note: I'm still organizing the Ruby on Ales conference. No way I'm leaving that amazing event behind.

We've left our friends and family behind to move to Portland. I don't know what it's going to be like not having Josh, Vincent, Andrea, John, Scott, Coby, Jonan, Colton, Luke, Timmy and Matt right there whenever we decide to do something or need some assistance. What I do know is that I already miss these people.

I'm from Portland and have spent the majority of my life there. All of my family is in Portland (Except for my sisters.), all of my wife's family is around Bend. For the longest time we've been coming to Portland for holidays and leisure. It felt like we were traveling to Portland to have fun and just stayed at home for work... and that never made sense to me. Rather then continue that pattern we decided to move to Portland in May 2011.

For various reasons we didn't make it over that May. It was a mixture of not finding the right house to buy and losing faith in the long term future of G5. I didn't want to buy a house and work remotely for a place I didn't think would be around for a couple years. We put our moving plans on hold and sat in limbo for a few months while we waited to see how things would pan out with G5. During those months the environment eroded so rapidly that I don't think a single person that left in 2010 would have recognized the place after mid-2011.

Up until September 2011 I hadn't entertained the idea of finding a new job. In lieu of a new gig, Josh and I were toying around with taking nVariable to the next level and consulting full-time while working on Pint.me. There was a problem though... My heart wasn't in consulting. I love focusing on entire lifecycle of a project and the hired gun role wasn't appealing to me at the time. I believe that in the future I'm going to regret missing that chance because I wasn't "into it", but I'm happy to have not gone into something I wasn't fully committed to.

At Cascadia Ruby Conf I had the chance to hear Rich Kilmer talk about some exciting stuff they were doing at LivingSocial and he really piqued my curiosity about what I might be able to do for them. It was then that I decided to start looking around at what opportunities were out there. There were two companies I was interested in: LivingSocial and Heroku. I put my hat into LivingSocial first and never really reached out to Heroku beyond telling my buddy Terence I was looking and to keep me in mind if they needed anyone on their Ruby team. To my surprise, shortly after reaching out to LivingSocial they had their recruiter call me. After a few months of missed connections, gmail spam folder rage and persistence from Rein Henrichs I was on a flight to Washington, DC for an in-person interview. The day after I had an offer, I quit G5 that day.

Once I cleared up the G5 connection my wife and I decided (well, mostly me) that the time was right to finally move to Portland. And now we're here, ready to start a new adventure for all of us.. including the new baby on the way.

TL;DR - Lived in Bend for 9 years, Got a job with LivingSocial, Moved to Portland.

I just saw a post in my tweet stream by Derek Neighbors in which he asserts that todays Rubyists are a "drone army":

The leaders have disappeared.  The second and third wave are just implementors. They are not idealistic.  The Merb team emerged full of new ideas and a swagger of yesterday but all that died when they merged back into Rails.

It used to be about changing the world.  Now it’s just about tools.  Workflows are broken and complex.  We fix them with tools instead of ideas.  Regional Ruby talks are littered with talks about tools or non Ruby ideas.  No one is talking about ideals and communities of change.
...
We have become the drone army.  We are losing.

I immediately took offense to this post, but I couldn't quite pin down where the emotion was coming from. I asked myself if Derek was right?

I decided he was wrong.

Ruby was never about revolution, Ruby is about making us, as developers, happy. For many of us it was a language whose syntax, expressiveness and quirks touched the right nerves. It was the feelings we got about the language that made us want to use it. It wasn't it's speed (lulz), it wasn't it's libraries and it sure wasn't its popularity. For many of the people that have been using Ruby for a long time, at one point they dreamed of getting a job that paid them to write Ruby. Today they are plenty of jobs.

And, mostly due to Rails, Ruby is a language that is still (rapidly) attracting new and exciting people to our community. All of these people bring new ideas and highlight unknown pains.

A side note:
I'm firmly in the camp that believes most new Rails developers today are poor Rubyist's. But, I believe its our responsibility to teach (Nicely) those people what the practices and paradigms our community has adopted are. It's also worth noting that some of the oldest members of the Ruby community are still here, and still helping as much as they can. Spend some time on #ruby-lang, you'll see.

At the heart of Derek's argument it would seem that the abundance of tools, and the creation of those and new tools or workflows are somehow unrelated to changing the status quo or spreading new ideas. I don't understand this argument. I get a smile whenever someone decides that a tool doesn't fit their needs so they make their own. I get exited whenever someone brings a new idea to Ruby or is unhappy about the way a library/application they use works so they fix it.

Derek also has a point about the abundance of "non Ruby ideas" at regional ruby events. Over the past year I agreed with him... until the weekend at Cascadia Ruby Conf. I had the pleasure of listening to John Barnette talk about the roller coaster of stress, physical & mental exhaustion and the blood, sweat and tears he was pouring into a startup.

It was at that moment that I realized that, getting up and standing in front of 100 of his peers to discuss that was exactly something our community has and always should support.

John Barnette never "revolutionized" Ruby, or software engineering or the world. John uses Ruby as a tool in his personal revolutions. We all use Ruby as a tool.

It could be a startup, it could be a game, it could be that they just wanted to see if something is possibly (cough Phuby cough). And just like John, there are countless other developers using Ruby to change their corner or the world.

With Ruby, we all do it a little happier than most.

Derek is a wonderful guy that has done amazing things for his community in Phoenix. This should not be mis-read as an attack on him or his ideas, I just disagree.

Split a git commit

This is a little rough, but I thought I would share a little screencast I did for a colleague.

Thanks Ed

Ed Roberts

Ed Roberts (1941 - 2010)

I was a lucky kid. I grew up with my grandparents and my mom; all of them pushed me hard to learn. They never told me what to focus on, they just did their best to embrace the things I fell in love with. One of those things was computers. If it wasn't for Ed Roberts there was no way my family could afford for me to learn how to program.

Ed cofounded MITS in 1969 and by 1975 MITS launched the Altair 8800. The Altair 8800 was the first successful personal computer (read: "They sold lots of them") and it was the computer that Microsoft developed their first commercial product for. The Altair was the computer that inspired Steve Jobs and Steve Wozniak to start a little company called Apple. By 1979 Apple has completely overshadowed MITS, but what Ed did was create the business model the PC world would follow to this day - including the concept of selling upgrades to your PC, peripherals, computer magazines, computer stores, Microsoft software and Intel CPU's.

Ed jump-started the industry that changed the world and I can't imagine what we would have today if Ed didn't do what he did.

Thanks Ed.

Intro

People want to start working on apps in Rails 3.0. Rails 3 is supporting ruby 1.8.7 and ruby 1.9.2. These instructions will assist you with getting Rails 3 and ruby 1.9.2 installed. I'm tossing this up here to have something to point people to when they have questions.

I'm making a few assumptions:

  1. You're on OS X Snow Leopard (x86_64) (Most of these instructions will work on any *nix box. Leave a comment if you have trouble.)
  2. You have macports install (or readline installed somewhere else on your box)

Install Ruby Version Manager

Note: Just run this command and follow the instructions.

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

Install Ruby 1.9.2

Note: Your readline directory may be in a different spot.

$ rvm install 1.9.2 -C --with-readline-dir=/opt/local,--build=x86_64-apple-darwin10
Installing Ruby from source to: /Users/mturner/.rvm/rubies/ruby-1.9.2-p0

Running autoconf

Configuring ruby-1.9.2-p0, this may take a while depending on your cpu(s)...

Compiling ruby-1.9.2-p0, this may take a while, depending on your cpu(s)...

Installing ruby-1.9.2-p0

Installation of ruby-1.9.2-p0 is complete.

Updating rubygems for ruby-1.9.2-p0

Installing gems for ruby-1.9.2-p0.

Installing rake

Installation of gems for ruby-1.9.2-p0 is complete.

$ rvm 1.9.2

$ ruby -v
ruby 1.9.2p0

Create a Rails 3.0 Gem set and switch to it

This processes allows us to isolate the Rails 3.0 environment gems.

$ rvm use --create 1.9.2@rails3

Install the Rails 3.0 Gems and dependencies

$ gem install sqlite3-ruby
$ env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
$ gem install rails

Done

Hopefully everything worked:

$ ruby -v
  ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
$ rails --version
  Rails 3.0.0
$ gem list
  *** LOCAL GEMS ***

  abstract (1.0.0)
  actionmailer (3.0.0)
  actionpack (3.0.0)
  activemodel (3.0.0)
  activerecord (3.0.0)
  activeresource (3.0.0)
  activesupport (3.0.0)
  arel (1.0.1)
  builder (2.1.2)
  bundler (1.0.0.rc.5)
  erubis (2.6.6)
  i18n (0.4.1)
  mail (2.2.5)
  memcache-client (1.8.5)
  mime-types (1.16)
  mysql (2.8.1)
  rack (1.2.1)
  rack-mount (0.6.12)
  rack-test (0.5.4)
  rails (3.0.0)
  railties (3.0.0)
  rake (0.8.7)
  sqlite3-ruby (1.3.1)
  text-format (1.0.0)
  text-hyphen (1.0.0)
  thor (0.14.0)
  tzinfo (0.3.22)

Switching back to your system Ruby

rvm system

Back to your Rails3.0 environment

rvm 1.9.2@rails3

Use your RVM environment as your Default

rvm 1.9.2@rails3 --default

Read more about RVM over at http://rvm.beginrescueend.com/

Update 04/16/2010

Updated to reflect the recent changes in RVM.

Update 08/18/2010

Updated to use the production release of 1.9.2

Update 08/30/2010

Updated to reflect the Rails 3.0 release.

I was assisting aridlous on irc while he was experiencing an issue launching the rails console in a Rails 3.0 beta app.

He was getting the following error:

$ script/console
/opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- set (LoadError)
   from /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
   from /opt/local/lib/ruby/gems/1.8/gems/bundler-0.9.7/lib/bundler/resolver.rb:1
   from /opt/local/lib/ruby/gems/1.8/gems/bundler-0.9.7/lib/bundler/runtime.rb:95:in `specs'
   from /opt/local/lib/ruby/gems/1.8/gems/bundler-0.9.7/lib/bundler/runtime.rb:81:in `specs_for'
   from /opt/local/lib/ruby/gems/1.8/gems/bundler-0.9.7/lib/bundler/runtime.rb:18:in `setup'
   from /opt/local/lib/ruby/gems/1.8/gems/bundler-0.9.7/lib/bundler.rb:66:in `setup'
   from /Users/User/dev/sekret/config/../config/preinitializer.rb:34
   from /Users/User/dev/sekret/config/boot.rb:28:in `load'
   from /Users/User/dev/sekret/config/boot.rb:28:in `preinitialize'
   from /Users/User/dev/sekret/config/boot.rb:10:in `boot!'
   from /Users/User/dev/sekret/config/boot.rb:129
   from script/console:2:in `require'
   from script/console:2

This appears to only affect folks using RVM and Bundler.

After a little sleuthing it appeared that RVM was setting a blank GEM_HOME environment variable when you leave the ruby version set to default.

$  env | grep GEM_HOME
GEM_HOME=

There are two easy fixes

1) unset GEM_HOME or 2) rvm system

Both of these clear the GEM_HOME environment variable.

aridlous dug around the bundler src after I helped him out and came back with the following tib-bit. I'd write a patch and probably will but I'm just too tired at the moment.

interesting, but the bug seems to be possibly 2 things: empty GEM_HOME should not be used, and when the join occurs I think it is creating an invalid GEM_PATH=":/Users/User/.gem/ruby/1.8:/opt/local/lib/ruby/gems/1.8:" ... it should not have that leading ':'

UPDATE: Filed an issue in Bundlers issue tracker

UPDATE 2: Fixed in 55509f

I enjoy using OpenSolaris when I can, and I've been using it for a couple small Ruby on Rails deployments. I've received a few questions recently about deploying Ruby on Rails app on OpenSolaris, so to kill a few 'birds' with one stone. I'm throwing this post together so that I can just point them here and let them run with it.

Sun has an easy to install meta-package called amp that includes Apache 2.2, Apache 2.2 DTrace probes, MySQL Server 5.1 & PHP. If you've never used Solaris/OpenSolaris before the pfexec command will seem foreign to you. Don't let it worry you its part of the Solaris RBAC (Role Based Access Control) by default the non-root user you created during the install has the root user role and can execute commands as root if you use pfexec.

I'm assuming you're starting from scratch on an OpenSolaris 2009.06 server with nothing extra installed. I also assume you've had some experience with a Unix/Linux variant.

Basics

We want to install some of the GNU stack including gmake, gcc and git + subversion. We're going to install git from source to be sure we're on the latest release.

gmake, gcc, subversion and curl

Commands:

  $ pfexec pkg install SUNWgmake
  $ pfexec pkg install SUNWgcc
  $ pfexec pkg install SUNWsvn
  $ pfexec pkg install SUNWcurl

git

curl is required to build git don't skip installing SUNWcurl from above.

Note: There seems to be an issue with building versions of git newer than 1.6.0.6 on OpenSolaris 2009.06. I'll figure out why but in the meantime I've provided instructions for installing git 1.6.0.6. Please verify that /usr/local/bin is in your $PATH.

Commands:

  $ pfexec mkdir -p /opt/src
  $ pfexec chmod 777 /opt/src
  $ cd /opt/src
  $ wget http://kernel.org/pub/software/scm/git/git-1.6.0.6.tar.gz
  $ tar xzf git-1.6.0.6.tar.gz
  $ git-1.6.0.6
  $ ./configure
  $ gmake
  $ pfexec make install 
  $ git --version

Apache Stack (AMP)

Like I noted above, OpenSolaris has a meta-package we can install that will take care of most of this. It will install the following packages for us:

  • MySQL Server 5.1
  • Apache 2.2.30
  • PHP 5.2.9

Commands:

  pfexec pkg install amp

Enable Apache & MySQL Services

By default the Apache and MySQL services are not enabled. To turn them on run the following commands:

Apache 2:

  pfexec svcadm enable http:apache22

MySQL

  pfexec svcadm enable mysql

Ruby & Ruby on Rails

First we are going to use the Sun provided Ruby 1.8.7 package that also installs rubygems. Then we will update rubygems, install the gemcutter gem, add http://gems.github.com as a gem source (for legacy purposes), install the rails gems and finally modify our path to include the gem binaries.

  pfexec pkg install SUNWruby18
  pfexec gem update --system
  pfexec gem install gemcutter
  gem tumble
  gem sources -a http://gems.github.com
  pfexec gem install rails
  echo 'export PATH=/usr/ruby/1.8/bin:$PATH' >> ~/.profile
  echo 'export PATH=/var/ruby/1.8/gem_home/bin:$PATH' >> ~/.profile

(Note: Modifying .profile requires you to re-login to the machine, as it's only read during that point. If you like you can add that same line to your .bashrc file)

Install Database Gems

Mysql:

  pfexec gem install mysql -- --with-mysql-dir=/usr/mysql/5.1

sqlite3

  pfexec gem install sqlite3-ruby

Passenger Installation

We need to install fastthread and passenger, then configure apache to use it. We're going to install passenger from source as it fixes a bug with the use of PTHREAD_STACK_MIN (See here) This is fixed in passenger 2.2.6 and I will update this when that is released.

  pfexec gem install fastthread
  cd /opt/src
  git clone git://github.com/FooBarWidget/passenger.git
  cd passenger
  pfexec ./bin/passenger-install-apache2-module

Apache Configuration

We're going to keep the passenger configuration in it's own file to keep the httpd.conf clean.

Create the file:

  touch /etc/apache2/2.2/conf.d/passenger.conf

Paste the lines from the passenger-install-apache2-module command in that file. My file contains the following:

  LoadModule passenger_module /opt/src/passenger/ext/apache2/mod_passenger.so
  PassengerRoot /opt/src/passenger
  PassengerRuby /usr/ruby/1.8/bin/ruby

Let's Test

Lets create a little rails app to verify that rails and passenger

  pfexec mkdir -p /data/apps
  pfexec chown -R mturner:staff /data/apps
  cd /data/apps
  rails test
  cd test
  ./script/generate controller helloworld index
  pfexec chown -R webservd:webservd test

Lets add a vhost config for apache.

  pfexec vim /etc/apache2/2.2/conf.d/test-site.conf

Here is the contents of my file:

     <VirtualHost *:80>
             ServerName test-site.com
             DocumentRoot /data/apps/test/public

             <Directory /data/apps/test>
              Options +FollowSymLinks -SymLinksIfOwnerMatch +MultiViews -Indexes -ExecCGI
              AllowOverride ALL
              Order allow,deny
              Allow from all
             </Directory>
     
        </VirtualHost>

Add 127.0.0.1 test-site.com to /etc/hosts

Restart Apache

  pfexec svcadm restart http:apache22

Test the site in apache and you see the following:

  Helloworld#index

  Find me in app/views/helloworld/index.html.erb

It Works!!