Ernie Miller

No, I don't work in NYC, DC, or the valley, and I'm cool with that.

RSS Feed

A little Subversion gotcha

Posted by Ernie on February 12, 2008 at 9:42 am

At the office, my development machine is (unfortunately) a Windows box. I was setting up Capistrano for an app I was about to deploy, and checked the deploy.rb, Capfile, and script/spin files into Subversion from my Windows machine. This led to an interesting little gotcha.

This app has a small user base, so I opted to only spawn two instances of Mongrel with the -i 2 option in script/spin, but for some reason, when deploying, I was still starting 3 each time. A quick analysis of the nohup.out file that gets created when starting the servers showed a message that -i 2 was an invalid option, and it was reverting to defaults. Of course, -i 2 is a valid option, so I was perplexed. Turns out, the Linux machine I was checking the source out to wasn’t liking the carriage returns from Windows. Windows uses CRLF as a line terminator, while UNIX-like platforms use LF only. This isn’t a problem for most files, really, but in the case of scripts like this one, having a bogus CR on the end of the line was causing it to be passed as part of the parameter.

The solution? Subversion’s svn:eol-style property. Setting this to “native” for a file causes it to receive the proper end-of-line treatment on the system that checks it out. Problem solved.

Filed under Uncategorized
Tagged as
You can leave a comment, or trackback from your own site.

About

I'm Ernie Miller. But then, you probably knew that by looking at the page title, or the URL. I'm a Ruby programmer in Louisville, Kentucky. This blog used to be called "metautonomo.us", which I thought was kind of clever, but nobody, including me, could type it. Lesson learned.