Rails and LDAP gotchas

February 28, 2007 Link to post  Permalink

I’ve spent some time over the last few days trying to access a Microsoft Active Directory (AD) using LDAP from a Rails app. Although there are some libraries and a few blog posts, this is still a very painful thing to do.

Here’s some things I worked through so you don’t have to.

Not a Ruby or Rails issue, but something you need to know – “dc=foo,dc=com” is not the same as “dc=com,dc=foo”. However, DC=Foo,DC=com is the same as dc=foo,dc=com

Chris Scharf has built the ruby ldap libraries for Windows Although the ruby-ldap site says the code relies on other libraries, on Windows, that code is built in.

Can Rails learn how to release software?

February 18, 2007 Link to post  Permalink

Mathew has an interesting post here about the problems with Rails 1.2, and the underlying issue of the Rails Core team not releasing software correctly.

I noticed the start of this with the 1.1.4 to 1.1.6 update (via a quick stop at 1.1.5). Looking at the change sets between the minor version changes, it was clear that we weren’t getting just a security update, but a few cool new features too. Ben and I talked about it at the time, and then Ben went on to blog about the issues

I seems that the situation hasn’t changed yet.

Apparently, DHH’s views on change are along the lines of ‘tough, this is the way I work, live with it’.

I have a new job!

February 16, 2007 Link to post  Permalink

As of this afternoon, I have a new employer. I will be starting work as a programmer at Zipper Interactive in Redmond on the 26th.

I talked with a bunch of people, and didn’t get around to talking with a bunch more, but the completely different environment of a game development company was too tempting to pass up. There’s a lot of Rails development going on in Seattle, not all of it publicly known.

Now I can take a week off without worrying about mortgage payments and job interviews.

Microsoft Puzzlehunt Atlantis finished

February 12, 2007 Link to post  Permalink

Our team – the Dirty Smackmasters – convened for the 10th Microsoft Puzzlehunt (Puzzlehunt A). This year was an Atlantis theme, and we did a little better than last time – we’ll probably be in the low 30’s our of 75 when the results come out. We solved all but 14 puzzles, and we had about 3 or 4 that we were really close on.

This year, we made great progress at the start, and someone has a screenshot of the standings page to show us in 2nd! I like it when the first puzzles allow you to make progress. One year, we solved nothing in the first 4 hours. This is a good way to make you feel stupid.

One tip to anyone making puzzles – don’t use pizza! This year, one of the puzzles involved the layout of olives on a delivered pizza. Our olives had all moved by the time we received it, so we had no chance to solve this until we got a photo of the expected layout. We wasted so much time on this, and then didn’t have enough time to solve it once we got the correct layout.

4 1/2 Rails plugins I use in every project

February 7, 2007 Link to post  Permalink

Any time I’m starting a Rails project, I pick which base plugins I’m going to need to get the job done. Here are the ones I use the most.

This is Stefan’s implementation of the SQL session store bypassing ActiveRecord for performance. Wasting cycles on loading the session is not what I want my servers to be spending their time on.

We all want to know when our production servers are having problems. The Exception Notification plugin sends you mail when exceptions occur. One note: Routing errors are not caught by this plugin, which may be important for you to catch.

Put the title of your model into the URL for that model, not just its ID. This is great for SEO purposes, and is easier to read when looking at urls.

2 Best Firefox plugins for Rails developers

February 4, 2007 Link to post  Permalink

Usually these lists are 10 best, but really, for Rails developers, there are only two plugins you really need.

The DevBoi plugin adds a sidebar with documentation lookup for HTML, CSS, DOM and Javascript.

The Rails addon pack gives you Rails and Ruby documentation too. Ctrl-F9 (on Windows) brings up the sidebar.

I can’t work without this plugin.

Dreamhost, Rails and locally installed Gems

February 3, 2007 Link to post  Permalink

I followed the instructions for installing Collaboa on Dreamhost, which includes building and installing local versions of everything interesting – Rails, Subversion, FastCGI, Gems.

The environment can be setup in the .bash_profile, .bashrc and .gemrc files to allow all the tools find these locally installed versions. .bashrc is claimed to be the place for non-interactive apps to get their configuration setup. It seems not, at least for the Dreamhost configuration.

After trying all the tricks in the book to get my Rails app running under FastCGI, I eventually worked out what was missing — my app wasn’t picking up the locally installed Gems.

To make this work, I added the following lines to my dispatch.fcgi file:

Where'd my job go?

January 31, 2007 Link to post  Permalink

The company I work for just went into ‘hibernation mode’, so we’re all out of work, at least temporarily, maybe permanently.

I’ve updated my entry on WorkingWithRails.com to show my new-found availability, and am waiting for the offers to come flying in!

tom@craz8.com will get you in touch with me, if you need a Rails programmer to do work on short notice.

Why is my code in a loop?

January 24, 2007 Link to post  Permalink

Today, I wrote some code that looked a little bit like this:

Imagine my surprise when my log output was a long stream of Update Called lines.

What happened here is that save is implemented as a call to update when the object already exists.

Inadvertently picking a method name that is the same as an important Rails method can be hard to track down. I already had my logging in there, so I wasn’t left wondering why the call never completed.

Start the weekend with a boat rescue!

January 20, 2007 Link to post  Permalink

Lisa and I just had a ‘Joe and Petunia’ moment.

I noticed a small boat in trouble just off shore from the Kirkland marina today. The boat just stopped and they started waving an orange flag – they also started bailing. Lisa called 911.

Before the rescue boat arrived, the boat in trouble drifted into the docks at the North end of Marina Park and the two gentlemen rescued themselves.