Recent Posts

Starting MySQL after upgrading to OS X Leopard

October 27, 2007

If you upgraded to OS X Leopard and are running MySQL from the MySQL.com installer[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”}, you might be having some problems with starting it from the GUI interface. There isn’t a fix from MySQL yet, so to get around that… you can run it from the command-line.

Start MySQL from the command line

cd /usr/local/mysql; ./bin/mysqld_safe &

This should get MySQL up and running for you. If someone wants to share a tip on how to get this to start automatically on reboot, please post a comment and I’ll help get the word out.


  1. ::: {#fn1}
I didn't have this problem as I [installed MySQL via
MacPorts](http://www.robbyonrails.com/articles/2007/06/19/installing-ruby-on-rails-and-postgresql-on-os-x-second-edition..).
but this came up for a few members of [PLANET
ARGON](http://planetargon.com) after they upgraded to
Leopard.[↩︎](#fnref1){.footnote-back role="doc-backlink"}
:::

OS X Leopard Tip: Skitch on Every Space

October 26, 2007

If you’re using Skitch and the new Spaces in OS X Leopard, I would encourage you to set the following up.

::: thumbnail skitch on every
space
Uploaded with Skitch!{style=”font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080”} :::

This will allow you to use Skitch on any Space without needing to move it around. Took me a few minutes to figure out that I could set it up like this.

As you can see… I’m on Leopard now… only took three tries.

Spice up your Terminal with colored grep pattern results

October 06, 2007

Earlier, I came across a post by Garry Dolley, which he shows how to acheive colorized grep matches in bash. I recall having color matches when I used to use Linux on a daily basis as my primary work environment, but haven’t gotten around to setting this up on my MacBook, which is where I do almost all of my development work.

Before

If you don’t already have colors, a grep in your terminal might look something like the following screenshot.

While, I have a very small output here, this gets much crazier when you’re using egrep across an entire project. It’s hard to scan through all of the results for the inline pattern matches.

So, taking Garry’s suggestion (for bash), I did something similar with my favorite shell, Z shell.

Add the following to your ~/.zshrc file to begin experimenting with the colors.

Multiple Database Connections in Ruby on Rails

October 05, 2007

We have a client that already has some database replication going on in their deployment and needed to have most of their Ruby on Rails application pull from slave servers, but the few writes would go to the master, which would then end up in their slaves.

So, I was able to quickly extend ActiveRecord with just two methods to achieve this. Anyhow, earlier today, someone in #caboose asked if there was any solutions to this and it prompted me to finally package this up into a quick and dirty Rails plugin.

Introducing… Active Delegate!

To install, do the following:

cd vendor/plugins;
piston import http://svn.planetargon.org/rails/plugins/active_delegate
```text
Next, you'll need to create another database entry in your
`database.yml`.

```yaml
login: &login
  adapter: postgresql
  host: localhost
  port: 5432

development:
  database: rubyurl_development
  <<: *login

test:
  database: rubyurl_test
  <<: *login

production:
  database: rubyurl_servant
  <<: *login

# NOTICE THE NEXT ENTRY/KEY
master_database:
  database: rubyurl_master
  <<: *login
````ruby
At this point, your Rails application won't talk to the
`master_database`, because nothing is being told to connect to it. So,
the current solution with Active Delegate is to create an ActiveRecord
model that will act as a connection handler.

````ruby
# app/models/master_database.rb
class MasterDatabase < ActiveRecord::Base
  handles_connection_for :master_database # <-- this matches the key from our database.yml
end  
```text
Now, in the model(s) that we'll want to have talk to this database,
we'll do add the following.

````ruby
# app/models/animal.rb
class Animal < ActiveRecord::Base
   delegates_connection_to :master_database, :on => [:create, :save, :destroy]
end

Now, when your application performs a create, save, or destroy, it’ll talk to the master database and your find calls will retrieve data from your servant database.

It’s late on a Friday afternoon and I felt compelled to toss this up for everyone. I think that this could be improved quite a bit, but it’s working great for the original problem that needed to be solved.

If you have feedback and/or bugs, please send us tickets.

PLANET ARGON is seeking fresh talent... could it be you?

October 04, 2007

My blog has been fairly quiet lately because our team has been busy helping push a few big client projects out the door. We’ll be posting announcements about those launches on the PLANET ARGON Blog soon, so stay-tuned there!

We’ve been growing the design-side of our team lately, but we’re also still seeking some more Rails-talent in Portland, OR. If you’re in Portland or interested in moving here[^1^](#fn1){#fnref1 .footnote-ref role=”doc-noteref”}, you should introduce yourself to our team. We’re looking for people to work on-site in Portland, so any remote candidates will be turned away… we’re moving into a shiny and new office space in downtown and are looking for another developer to join our Design and Development team.

PLANET ARGON goes
hiking{width=”333” height=”500”}
[you’ll fit in really well if you’re into outdoor activities… ;-)]{.small}

We’re seeking mid-level Ruby on Rails developers that can pick things up quickly. Having some experience with RSpec will go along way with us. Ideal candidates would have great communication skills and be able to work in a fast-paced environment that places a huge emphasis on collaboration between designers and developers (let’s not forget to mention our clients). Bring what you already know and learn the rest with us.


[While everyone might have Wii’s in the office, we’ve taken it to the next level with Speed Stacking! :-p]{.small}

To apply, send an email to <af22+8509@c1.catchthebest.com>,

Side note: We’re giving Catch the Best a whirl to review job candidates. If you’re hiring people, you might consider giving it a try.


  1. ::: {#fn1}
Everybody is moving to Portland... ;-)[↩︎](#fnref1){.footnote-back
role="doc-backlink"}
:::

Edge Rails Documentation: Revisited

September 26, 2007

This question, “where can I find documentation for Edge Rails?” still comes up quite often on mailing lists, IRC, and other places. I just wanted to point out a few resources for you.

In March 2006, our team announced that we’d be updating a RDOC site a few times a day as the Rails project gets commits.

You can still access the PLANET ARGON Edge Rails documentation here:

Caboose also has some Edge Rails documentation here:

If you’re aware of any other online resources for Edge Rails documentation, please let me know.

Rails Business: 'Weekly' Review #4

September 25, 2007

As I mentioned in my last review, I wouldn’t be updating on a weekly basis, which is a shame because there are so many fascinating discussions going on that might benefit you if you’re running a business that uses and/or relies on the Ruby on Rails framework. I’d like to highlight some of the discussions that have been taking place over the past month or so.

First off… wow! As of this morning, there are *650 members!

Some Recent Discussions

Obtaining Ruby Gigs

Johan Pretorius started a discussion with the following…

“I’ve been lurking on the group for a while now, the time has come to participate … What strategy would you recommend for somebody that wants to break into the Ruby (on Rails) market?”

On a related topic, Jose Hurtado started a discussion asking for tips on how to get a reputation in the Ruby on Rails community for you business.

Some of the responses included:

  • Start a portfolio
  • Contribute to Open Source projects
  • Contribute to Rails through Documentation
  • Subcontract through well-known developers
  • Start a blog
  • Write a book

Read the entire thread and please share any other ideas that you have on this topic with Johan, Jose, and rest of the list. :-)

Taking a full-time job, what about your freelance clients?

Oren writes, “I got a full-time job offer as employee (and not on as a contractor). My current client might need some help on the weekends in the next month, so I might still do contract work. Can I keep my corporation (corp S) while working full time?”

Read the responses

Reality Check!

Starting your own business might sound like an amazing thing to do, but it often comes with a lot of consequences and struggles, which I’m definitely not been immune to.

Michael M. writes, “…added to having to create a company, perform customer support, continue to grow the features, marketing, and the loads of other things I haven’t thought of yet…is there any hope that one person can pull this off while still working at my current job ( with hopes of going it alone when I’m sure it can fly ), and giving time to my family, with very little up front costs. I’ve been reading quite a bit about bootstrapping lately, but to really make the time has been very difficult.”

There were several thoughtful responses where well-known members of the Ruby on Rails community, such as Joe O’Brien Ben Curtis shared through personal experiences.

Joe O’Brien wrote, “I wanted to mainly chime in on the family part. Something that has taken a year for me to figure out how to balance. I would not have been able to do any of it, had it not been for my wife’s full support. I have three kids, all of whom I love spending time with, so figuring out a way to balance it all has been very tricky. Up front though, my wife and I knew this would not be your typical job. It helped that I used to travel and now do not, but it has still been an
adjustment.”

If you’ve been running your own Rails business, please consider responding to this thread and sharing your experience.

Join the Community

As mentioned, this is just a small sample of some of the great discussions taking place on the Rails Business mailing list. If you’re an aspiring Rails freelancer or business owner, be sure to join the community and share your experiences and learn from other members of the community that are willing to share theirs.

As always, have fun!

Boxcar: Open for business

September 04, 2007

We’ve been quietly rolling out our new Rails hosting solution over the past month, each week… inviting more people to ask questions and place orders. Initially, we invited some of our business hosting customers, and then sent out invites to those who signed up on the Rails Boxcar announcement list. We’ve been taking orders for the past few weeks and have had sites running on Boxcar for over a month now.

You’ll also notice that we’ve begun to phase out all of our older shared hosting solutions for new customers and are focusing solely on our Business and Boxcar accounts (aside from custom managed/dedicated solutions that we’ve been offering upon request).

To learn more about Rails Boxcar, read the announcement on the PLANET ARGON blog.

In other news, Daniel Johnson, our Lead Systems Administrator broke his arm while riding his bike while participating in Zoo Bomb (and cracked his helmet in the process). He’s at home today on pain medicine and we hope that he has a swift recovery.

RubyURL bookmarklet 2.0

August 28, 2007

If you’re using the bookmarklet for RubyURL, you will want to update it with the latest version as there was apparently a bug in the JavaScript and some URLs would fail to redirect properly. Thanks to the help of Jerome, this is now fixed.

So, head over to RubyURL and update your bookmarket. Not sure what I’m talking about? Watch the video.

Rails Development Performance Tip - dev_mode_performance_fixes

August 28, 2007

When you’re running a Rails application in development mode, you might notice that it takes a little longer for requests to get processed and this is somewhat intentional as the framework is was designed to allow you to run the application and make live changes to it. This way you can do some basic functional tests from your web browser, work on HTML/CSS changes, or anything else that might need to be done in development mode.

Anyhow, this can be slow from time to time and if you’ve done much Ajax work, you might be familiar with how slow this can feel when performing some basic tasks. Well, thanks to Josh Goebel, we can speed up things with a new plugin he just released.

To install via piston: