Windows & Unix development with Rails

November 3, 2005 Link to post  Permalink

My development environment is Windows. My production environment will be some form of Linux. I have a Debian server setup to test production issues. I have started playing with SwitchTower to deploy my production environment.

Once I’d set the whole thing up, SwitchTower almost worked first time. I eventually found the two reasons it didn’t work first time:

  • The dispatch.fcgi file was not marked executable when checked out of subversion
  • The dispatch.fcgi file needed to be editted and saved on the Debian system before lighttpd would run the file. It turns out that the end-of-line character is important for executable script files.

So, how to solve this? A quick search through the subversion documentation found two items:

  • svn:executable – sets the file to executable on those file systems that support it.
  • svn:eol-style – value of native tells subversion to use the appropriate end-of-line characters for the current OS.

Adding these two properties to my Rails scripts (dispatch.fcgi and everything in the script directory) and all is well with my SwitchTower processing.