Recent Posts - Page 18

Airplane customers prefer bland food...?

July 02, 2007

Earlier today, I was booking flights for Graeme and myself as we’re heading to Minnesota soon to visit one of our clients. While purchasing the tickets on Travelocity, I was glad to know that they remember that I’m a vegetarian. However, I almost made the mistake of submitting the form with the following meal preference for Graeme.

I found it amusing that this was the default in the drop down.

One ID to rule them all

June 25, 2007

I finally decided to put my claimID to use today with the announcement that Basecamp now supports openID. This means that I can easily access all of my Basecamp project with a single login. Some of our clients have their own Basecamp projects and having everything spread around (different usernames, passwords…) made it difficult to manage. I just modified my accounts on a few Basecamp sites and now see them all listed for me to navigate between.

update: Minor annoyance. This caused all my RSS feeds to break because I subscribe to each project individually. I assumed that they’d allow me to now use my openid/password for all my RSS feeds/iCal subscriptions, but they provide you some unique hash for the password. Not sure why they decided to do that… instead of allowing me to use my openid/pass for the subscriptions.

Put Your Controllers on a Diet already!

June 19, 2007

If you’re working with Ruby on Rails and are looking for ways to improve your existing code base, I would encourage you all to read the following blog posts.

Hopefully… you’ve already read each of them and as a result… put your controllers on a diet.

Installing Ruby on Rails and PostgreSQL on OS X, Second Edition

June 19, 2007

It’s been just over a year since I posted the article, Install Ruby, Rails, and PostgreSQL on OSX and it still gets quite a bit of traffic. Unfortunately, there have been a few changes in the install process that have caught people.

Today, I am leaving my PowerBook G4. It’s being replaced with a MacBook because the logic board is on the fritz. So, guess what that means? I get to install Ruby, Ruby on Rails, PostgreSQL on OS X again! I figured that I would post a revised version of my previous article for those who may go through this same process in the near future.

::: warning [WARNING]{.caps}: This post contains some outdated instructions. Please read Installing Ruby on Rails and PostgreSQL on [OS X]{.caps}, Third Edition, which is focused on Installing Ruby on Rails on Leopard. :::

Step Zero: Install iTerm (optional)

You’ll spend a lot of time in your terminal as a Rails developer. I’m not a big fan of Terminal.app as it lacks tabbed windows1 and you’ll often find me with around ten tabs open. I’ve been using iTerm for a few years and it’s definitely improved in the past year and doesn’t seem to crash nearly as often as it used to.

Once installed, I always change the default color scheme as I prefer the white on black schema. The menus in iTerm are lacking some thoughtful interaction design, but I’ve figured out the right way to do it (after a long time of stumbling on it by accident). In iTerm, you’ll want to edit the Default bookmark, which you can access by going to Manage Bookmarks under the Bookmarks Menu.

Set the Display value to classic iTerm and you’re golden.

Now… let’s get to business…

Step 1: Install Xcode Tools

Without installing Xcode tools from Apple, we’re not going to get very far. First, you’ll need to grab a copy of Xcode, which you can download on Apple’s Developer Connection site. It’s almost a 1GB download, so you’ll want to start your download and use your multi-tasking skills and grab a Viso, read some blog posts.

I’m going to make the assumption here that you know how to install a dmg on osx. Once this is installed, you can move on to the next step!

Step 2: All Your MacPorts are Belong to Us

MacPorts (formerly known as DarwinPorts) is a package management system for OS X. This is what we’ll use to install most of the necessary programs to develop and run your Ruby on Rails applications. If you’re from the Linux or BSD world, you are likely familiar with similar tools… such as: apt-get, port, and yum.

You’ll want to download MacPorts and install the dmg file.

Now that this is installed, we should test it.

With a new terminal, run the following:

$ port version
Version: 1.442

Success! Let’s get going…

Step 3: Installing the Ruby on Rails development stack

We’re going to go through a series of small steps, which may take some time depending on how fast your internet connection and computer is.

Install Ruby and RubyGems

In order to install Ruby, we’re going to use MacPorts with the port command, which is now available for installing various packages on our OS X machines.

$ sudo port install ruby rb-rubygems

It’ll probably take a while to download and install Ruby and all of it’s known dependencies. In the meantime, check out some funny code. KTHXBYE!

Still waiting for it to install, perhaps you could do something like… begin writing a comment on this post, writing your own blog post, watch a funny video, or recommend me. I walked to Backspace with Gary to get an Americano… and it’s still not done. :-p

(minutes/hours/weeks later)

Okay… I trust that it finished installing Ruby and RubyGems without any hiccups. Let’s test them from our terminal to make sure.

Let’s check the version…

$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]

Now, let’s make sure that Ruby is working properly…

$ irb
irb(main):001:0> x = 1     
=> 1
irb(main):002:0> puts "wee!!!" if x == 1
wee!!!

Great, we’re on a roll. Let’s get the rest of the stack installed.

Install Ruby on Rails

We’re going to install Ruby on Rails with the gem command that installing RubyGems provided.

$ sudo gem install -y rails

This command should produce an output similar to the following.

Successfully installed rails-1.2.3
Successfully installed rake-0.7.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
Installing ri documentation for rake-0.7.3...
Installing ri documentation for activesupport-1.4.2...
Installing ri documentation for activerecord-1.15.3...
Installing ri documentation for actionpack-1.13.3...
Installing ri documentation for actionmailer-1.3.3...
Installing ri documentation for actionwebservice-1.2.3...
Installing RDoc documentation for rake-0.7.3...
Installing RDoc documentation for activesupport-1.4.2...
Installing RDoc documentation for activerecord-1.15.3...
Installing RDoc documentation for actionpack-1.13.3...
Installing RDoc documentation for actionmailer-1.3.3...
Installing RDoc documentation for actionwebservice-1.2.3...	

Install Rails-friendly gems

Mongrel

If you’re developing with Rails, it’s highly recommended that you use install and use Mongrel for your development and production environments. The following command will install the mongrel and mongrel_cluster gems (including their dependencies).

$ sudo gem install -y mongrel mongrel_cluster

* Note: Be sure to select the proper platform for mongrel. (hint: OS X is NOT mswin32)

My terminal output:

$ sudo gem install -y mongrel mongrel_cluster
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mongrel 1.0.1 (mswin32)
 2. mongrel 1.0.1 (ruby)
 3. mongrel 1.0 (mswin32)
 4. mongrel 1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
> 2
Select which gem to install for your platform (i686-darwin8.9.1)
 1. fastthread 1.0 (ruby)
 2. fastthread 1.0 (mswin32)
 3. fastthread 0.6.4.1 (mswin32)
 4. fastthread 0.6.4.1 (ruby)
 5. Skip this gem
 6. Cancel installation
> 1
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed mongrel-1.0.1
Successfully installed daemons-1.0.6
Successfully installed fastthread-1.0
Successfully installed gem_plugin-0.2.2
Successfully installed cgi_multipart_eof_fix-2.1
Installing ri documentation for mongrel-1.0.1...
Installing ri documentation for daemons-1.0.6...
Installing ri documentation for gem_plugin-0.2.2...
Installing ri documentation for cgi_multipart_eof_fix-2.1...
Installing RDoc documentation for mongrel-1.0.1...
Installing RDoc documentation for daemons-1.0.6...
Installing RDoc documentation for gem_plugin-0.2.2...
Installing RDoc documentation for cgi_multipart_eof_fix-2.1...
Successfully installed mongrel_cluster-0.2.1	

Step 4: Installing the World’s Most Advanced Database Server… PostgreSQL!

At PLANET ARGON, we develop our applications on top of PostgreSQL. I’ve long been advocating the adoption of this awesome open source database in the Rails community. Just over a year ago, Jeremy Voorhis (PLANET ARGON alumnus) and I were interviewed on the Ruby on Rails podcast and had the opportunity to discuss our preference of PostgreSQL over the alternatives (mysql, sqlite, firebird, etc.).

We’re going to install PostgreSQL 8.2 from MacPorts by running the following command.

$ sudo port install postgresql82 postgresql82-server

While this is installing, you might take a moment to check out some space shuttles.

Setting up PostgreSQL

You may have noticed the output of the previous port installation of PostgreSQL 8.2, suggested that you do the following. Let’s do that now…

$ sudo mkdir -p /opt/local/var/db/postgresql82/defaultdb
$ sudo chown postgres:postgres /opt/local/var/db/postgresql82/defaultdb
$ sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'	

Have PostgreSQL start automatically on system start-ups

Unless you’re concerned about extra applications running in the background, I’d encourage you to add PostgreSQL to launchd, which will start it automatically after system reboots.

$ sudo port install ruby rb-rubygems
```0

#### Adding PostgreSQL commands to your \$PATH

For some reason, MacPorts doesn't add the PostgreSQL programs to the
default bash PATH, which means that you can't run `psql`, `pg_dump`, or
`createdb`/@dropdb@ without specifying the full path to where they were
installed. What we'll do is add them to our default terminal profile.

$ sudo port install ruby rb-rubygems


(you can use `mate`, `emacs`, `joe` or any other preferred editor to do
this)

This file gets loaded every time a new terminal session is started.

Let's add `/opt/local/lib/postgresql82/bin` to the end of the value for
PATH.

$ sudo port install ruby rb-rubygems


Save the file and then open a new terminal. To test this, you should get
the following output when you run `which psql`.

$ sudo port install ruby rb-rubygems


#### Creating a new PostgreSQL user

When I'm working on Rails applications in my development environment, I
really don't want to have to specify a username and password in every
`config/database.yml` file for each of our ongoing client projects. When
PostgreSQL was installed, it created a superuser named `postgres`, which
is great, but I'd like one that matches my system username, so that I'm
not prompted at all for a username or password to connect to PostgreSQL.

To do this, we'll use the `createuser` command, which comes with
PostgreSQL. As you can see, I'm creating a new user with superuser
privileges (and will hopefully be the last time I have to do a -U
postgres).

$ sudo port install ruby rb-rubygems


Let's take a quick moment to test this out.

$ sudo port install ruby rb-rubygems


Great, everything looks good here.

We now have a running installation of PostgreSQL with a new user
account. All we need to do now is install the appropriate RubyGem to
allow our Ruby applications to connect to it.

### Installing the Ruby Postgres gem

**UPDATE**: Hydro posted a commented, which lead me to the ruby-postgres
gem.

You can install ruby-postgres gem by running the following command.

$ sudo port install ruby rb-rubygems


Let's take a moment to test that this installed properly.

$ sudo port install ruby rb-rubygems ```7

If this returns true, than we should be good to go. We’ve now built a professional development environment for working with Ruby on Rails. Doesn’t that feel great?

Test your install

You can look back at my older post to walk through the process of testing out your setup with a new Rails application.

Closing thoughts

I hope that this post has been useful for you. It took me a few hours to walk through this process and it’s how all of our designers and developers at PLANET ARGON installs and configures their development environment.

We also install the following programs on new machines.

  • TextMate
  • Subversion: sudo port install subversion
  • RSpec: sudo gem install -y rspec
  • …amongst other gems that are needed on specific projects

Until next time… have fun!


  1. Rumor: Mac OS X Leopard will give Terminal.app tabs! ([see screenshot](http://www.apple.com/macosx/leopard/technology/unix.html))↩︎

Berkun introduces ADD

June 19, 2007

Author of The Art of Project Management, Scott Berkun, introduces Asshole Driven development.

“Asshole Driven development (ADD) - Any team where the biggest jerk makes all the big decisions is asshole driven development. All wisdom, logic or process goes out the window when Mr. Asshole is in the room, doing whatever idiotic, selfish thing he thinks is best. There may rules and processes, but Mr. A breaks them and people follow anyway.”

Read the rest…

Rails Code Audits and Reviews, continued

June 18, 2007

In response to my article, Audit Your Rails Development Team, Tim Case writes,

“I think what you are doing has value and I’ve been anticipating that someone in the rails community would step up and do this, hence the question I posed because I’ve thought about that thorny issue too. I have a feeling Planet Argon is making the first step in a direction that has been building, Peer review has the potential to be positive for the entire community, provided that it’s shepherded properly and with care.”

It’s been just over a year since we first made a public announcement of our Rails Code Audit and Review service and we’ve had different types of clients inquire about it. We make sure to call it a code audit and review because we’re not aiming to only point out flaws. We see our service as a way to help stake holders gauge the capabilities of their developers while also providing developers with some more insight to how things could be done differently. There are a lot of developers using Ruby on Rails now and it’s safe to say that there are many that aren’t very good yet. Some may argue that the ease of getting started with Rails makes it easy for inexperienced developers to stay just good enough and never take the next step. We’ve seen some beautiful code and we’ve seen some horrific code. Some of our clients have made the tough decision to fire their existing freelancers after we’ve completed our analysis… but we’ve seen several situations where our clients were happier with their developers after.

For example, we recently completed a code audit and review for a client, which came to us with some concerns about their development team. Things seemed to be going slower than they thought it would and really wanted to have an outside opinion about the quality of their work. Overall, their application was being developed really well and the biggest problems that they had were related to a lack of testing. So, we’re now walking them through the process of integrating RSpec into their development process. Their development team admitted that they suffered from a lack of testing, but were very honest about the fact that they just didn’t know where to begin as it wasn’t something they had time to learn before. We’ve been able to provide them with some direction and now we’re available to answer questions and review their work from time to time. The outcome was good for everyone. The developers are better off because their manager has more confidence in them. The manager has more confidence in the product as a whole and knows exactly where his team should focus their attention on next. We’ve gained a new Rails consulting client and get to help them with their cool project.

While we love working on entire projects from start to finish, we also love working with other developers and development teams. This has been one of our favorite types of client relationships. We’re currently working with a handful of people as they work their way through the project life cycle and we’re always a phone call, Basecamp message, or email away from assisting them. I feel that these types of services are important to the Rails community, because we’ve witnessed situations where clients were unhappy with Rails because they weren’t happy with their developers. We’ve seen people drop Rails in favor of something else because of the poor quality of code that was being written in Rails. When bad perceptions spread, it’s bad for the community as a whole.

What we can do, is become the backup team for the client and/or development team. Should they run into any weird deployment issues at 2am on a Sunday morning or aren’t able to track down the cause of some performance issue, we’re another set of people that can help out. While we don’t know every nook and cranny of our consulting clients’ applications, we do have a good understanding of them. This allows us to dive in and help more quickly than we can for clients that call us for the first time a few hours after they had an emergency.

It’s my opinion that these types of services are very valuable and highly encourage other consultancies in the Rails community to offer them.

If you’re part of a development team and/or a freelance developer and looking for this sort of relationship, please contact us to see how we can assist you.

Rails Business: Weekly Review #2

June 18, 2007

First of all, I’d like to welcome the more than fifty people that have joined the Rails Business group since my last post. Over the past week, there were less posts, but we did cover a few important topics, which may be of interest to you.

Subcontracting

Michael Breen asked a few questions about subcontracting for larger firms and how people set their rates when doing this. Several of the responses provided some personal experiences (good and bad) of being a subcontractor on large projects. Where some risks are and how to negotiate your rates, when applicable.

Read the discussion

Change Requests

Nick Coyne started a discussion on how to manage change requests in an Agile development process.

Dealing with large clients

There was also a discussion about how to go about responding to a 150 page RFP for a large client. A few of us offered our experiences of bidding on large projects. Read more

Join the Community

The list is about to pass 400 members and it’s already proving to be a valuable resource for all of you entrepreneurs out there. I encourage you all to introduce yourself.

Audit Your Rails Development Team

June 17, 2007

Several months ago, a few of your colleagues decided to join forces with you as you had come up with a concept for an innovative web application, shared the ideas with your friends and relatives, and began developing a business plan. After a few months of performing some initial market research, working on your pitch, and raising some initial funding, you decided to bootstrap the project and start designing and developing the product.

During your research phase, you came across several articles about this exciting new technology called, Ruby on Rails. You were impressed with many of the sites that were being developed on this new framework as well as the community that surrounded it. Your team decided that it would be a great idea to follow this trend and use Rails as the platform for your new product.

At this point, you began soliciting freelance developers and/or firms to hire for the design and implementation of your project. Eventually, you make a decision and break ground on building the product.

Let’s jump forward to the present day.

You’ve been in heavy development for quite some time. Your product has gone through a series of design changes and you’ve recently begun to allow other people to begin testing the application. You’re receiving a lot of bug reports as people use the system. Your development team quickly fixes them as they appear, but you’re noticing a trend in the development process.

The speed of implementing new features is drastically slowing down as your development team is spending most of their time fixing bugs. Along with that, they are becoming frustrated by the project because they can’t keep up with your new feature requests while trying to keep up with your growing number of bug reports. You’re becoming concerned about the stability of the product and are slightly suspicious that your developer(s) might not be as good as they suggested they were.

Did you hire a bad development team? Chances are, you may not be able to tell. You’re not a developer, so reviewing their code would almost be a waste of time. How would you know if they were doing a good or bad job? Your developers reassure you that things are going to work out in the end, but it’s going to take longer then originally planned. Along with this, your partners and investors are anxiously waiting for you to launch the product, but something feels wrong. You’re worried that launching it too soon could be the quick death of the entire project if it all comes to a screeching halt due to unforeseen bugs and problems with the application. This wasn’t how you pictured the launch of your exciting new product and you feel a lack of confidence in the entire process.

What can you do?

Before I get into that, let’s discuss some of the possible causes for this situation.

  • Your development team may have grossly underestimated this project.
  • You might have pushed too many features into the initial release of the product and your development team might not have done a good job of helping you determine what you need, not just what you want.
  • Your development team might not emphasize testing enough in their process.
  • Your development team may have begun to take a lot of short cuts in an effort to hit your launch date(s)
  • Perhaps you asked for quick turnarounds on new features before an investor meeting… maybe this happened on several occasions.
  • Your development team might not be very good with Ruby on Rails, maybe this was their first Rails project.
  • …and so on.

At this point, the big question is… what’s the problem?

Can you answer this question yourself? Can your development team answer it? If not, what do you do? How can you get an accurate understanding of how stable the code base of your application is?

Answer: An independent code audit and review

Why is this a good idea? Well, when you have an independent team review your code, you get the benefit of having a fresh perspective.. and often times, an independent team can be much more critical and provide an honest assessment in a very short period of time. This is especially true if they have a lot of experience with the technology. For example, PLANET ARGON has been conducting code audits on existing projects for over two years. We’ve designed a process for checking existing code bases for mistakes that we’ve either made ourselves in the past or found in other projects that we’ve reviewed.

In fact, our process currently walks us through the following areas of your Rails application.

  • Security of the application
  • Privacy of users’ personal data
  • Adherence to the conventions of the Ruby on Rails framework
  • Scalability of the application
  • Performance of the application and data model
  • Testing framework and process
  • User interaction (when applicable)
  • Information Architecture
  • Model-View-Controller (MVC) implementation and organization

Not only does this process provide you with our analysis, but we also provide you with our advice as to where your development team should focus their attention next. If your team is lacking experience in the areas that we recommend they focus on, we’re also here to help them through this with our consulting services. We’re currently assisting several Rails development teams with their testing process, refactoring, user interaction design, optimizing their site, improving their deployment strategy, and plan the implementation of new features.

In general, most freelancers and firms could/should provide you this service, but it should not be performed by your existing development team. They have a bias towards their process and this is your chance to get a second (or third) opinion on the work that you’ve been paying them for. If you’re spending several tens/hundreds of thousands of dollars into this product, an independent review of your investment should be something to seriously consider.

There are several different scenarios that could lead you to deciding to have an independent firm perform a code audit. In fact, I’d encourage you to always get an outside perspective of your team’s work.

You can learn more about our Ruby on Rails Code Audit service on our website or by giving us a call at +1 877 55 ARGON.

Rails Business: Weekly Review #1

June 09, 2007

This past week (give or take a few days), the Rails Business group has covered a lot of topics, that might be of interest to you, should you be running a business and using Ruby on Rails. Many of the members of the new group are independent contractors and have been very open in sharing their experiences of working for themselves. I’d like to take a moment to highlight a few conversations and tips that were covered this past week.

Health Coverage

Mike Pence started a conversation about health coverage…

“Has anyone else found the medical insurance issue to be a show stopper for them? Are you one doctor visit and diagnosis away from financial ruin? I can tell you firsthand that wishful thinking won’t pay those bills…”

This started a discussion about how people are able to work on their own and maintain health coverage, which is definitely not something that should be considered lightly. Read more…

Client Expenses

Another great question was raised by Mike Breen.

“I’m going to start work on my first project that will require me to travel. How should I handle the expenses? Do I build the costs into the contract price or do I submit the expenses to the client for reimbursements? Or does this vary from client to client based on the company policy?”

The responses included links to IRS sites and sections of other peoples’ contracts. Read more.

Hosting Client Repositories

Where do you host your client’s source code repositories? Are you managing it all yourself on your own servers or using a service?

The discussion (so far) has lead us to evaluate our own solution for this at PLANET ARGON. It appears that everyone has different concerns about how they want to manage client code during the development cycle.

For example, do you allow your client access to trunk/ if they aren’t all paid up yet?

Also, it seems like there are a bunch of new commercial options coming out (and are built on Rails). Read more.

Naming Your Business

Jared Haworth writes,

“For those of you who are working as ‘independent developers,’ have you found that it makes more sense to simply do business under your own name, for example “Jared Haworth L.L.C.,” or to come up with a clever business name instead, such as “Code Fusion Studios”?”

This was a good conversation to follow and definitely raised a lot of great questions and things to consider in response to the original message. Read more.

Other Topics

  • Magazines, what business magazines do you read?
  • Where do you find gigs?

Join the Community!

The community is still only a few weeks old and we’re already approach 350 members! It’s been a great learning about other peoples’ experiences… as well as sharing what I’ve learned since I started PLANET ARGON (and how the name came to be).

If you hadn’t had a chance to join, stop by and introduce yourself!

AT&T Online Support could use some QA

June 06, 2007

So, I was trying to send AT&T wireless a support email through their online system and got stuck at the following screen.

Umm...
how?

Come on guys… you can design a better form than this… and I’m now going to have to try and sneak in a question under a sub-topic that doesn’t apply to my question… just so I can send you an email?

Getting help shouldn’t be so hard1.


  1. At least I can Print this page and show all my friends… ↩

Last.fm bought by CBS

June 03, 2007

In an article on FastCompany.com, Lynne d Johnson writes..

“I’ve been a paid subscriber of last.fm since 2005, and over the course of time”

I’m confused… since when did you have to pay for a subscription to last.fm?

Read the article, What will CBS do with Last.FM

I’ve been using it for much over two years and passed the 31k song mark recently. I am curious about what CBS plans to with it…

Ruby on Rails gets down to business

May 29, 2007

It’s been a week since I announced the new Ruby on Rails meets the business world group. Already, the group attracted over 300 members from around the globe… from Argentina, Boston, Australia, Florida, Seattle, Portland!, the Netherlands, and South Africa.

We’ve already seen some great topics come up… from:

  • Project estimates
  • Fixed bids versus time and materials
  • Pricing
  • Handling code ownership with client contracts
  • Incorporating (LLC, S CORP?)
  • Managing money/accounting
  • Contracts

I expect that many of these topics will resurface and there has been a lot of valuable information passed around. It’s exciting to see that so many people not only want to use Ruby on Rails as a platform of choice for their business ventures, but they’re also willing to share their personal experiences and knowledge to help others move into this space.

If you’re running a business that focuses on Ruby on Rails or just considering it, you should stop by and introduce yourself.

update: membership grew from 200 to over 300 in the past day!