Development Environment

I want to be able to code my rails apps either on my Desktop mac or
my Powerbook using textmate.

I want to build a Debian server that runs lighttpd, rails and mysql.

Would I use samba on the server and access the files that way through
TextMate or is there something else that folks use? and should I
use subversion and if so, how would I do that in the scanario I’m
describing.

Basically I’m not wanting any web servers, db servers etc on the
powerbook or desktop just a copy of textmate and then access the
source on the server.

Any help or tips appreciated.

Rob

Wrong approach. I don’t like to be so dismissive, but really, for Rails,
it is. Develop locally, with a lightweight db (MySQL is plenty), and use
the tiny built-in webserver that comes with Rails whether it’s WEBrick
or the minimal lighttpd that comes with some all-in-one installers. Work
with local files checked out of Subversion or other version control.
It’s much, much, much easier than working with remote files and a remote
development webserver. Rails was designed for this from the ground up.

  1. Start developing locally on your laptop. No remote files or servers
    at all.
  2. Set up a Subversion repository.
  3. Import your code into it.
  4. Check it back out into a new directory. Make this your new working
    directory.
  5. Check it out on your desktop, too.
  6. Develop on either machine. As long as you upload your changes and
    pull them down when you switch machines, you’re always working on your
    latest code and never have to worry about Samba outages, network
    glitches, etc.

Subversion gets you version control, a revision history, the ability to
look at your changes, roll things back, and develop on your laptop even
without a net connection. You can work anywhere and sync up your changes
when you choose and unlike the last 12 years of freely-available web
development environments, in Rails it’s easier to do this than it is to
work with the proverbial Samba file share or (S)FTP directory.

Since you’d be working with local copies on both development machines,
your work won’t be disrupted by intermittent server or net outages that
can make working with a remote file share pretty awful. Working directly
on unversioned files on a file server is so 1995. The only thing worse
would be working remotely on unversioned files that are simultaneously
being served live by the public webserver. Once you’ve used decent
version control that integrates with your IDE or editor, you won’t ever
want to develop with folders of unversioned files again. A couple of
days of developing with a free trial hosted subversion repository sold
me on it, and I installed it on my server.

Besides, when your app gets to the point where you want to deploy it to
a public server, Capistrano makes civilized deployment directly from
version control easier than dragging a folder to an SFTP window. With
a half-hour of configuration and tweaking, I got Capistrano deploying my
app, updating the db schema, setting permissions and restarting FCGI and
Apache with one command.

I’d put a Subversion repository on a 24/7 remote server, whether it’s
your theoretical dedicated Debian box (which is probably overkill and
too much admin work until your app’s traffic justifies it), or shared
hosting or preferably a VPS account, which gets you the flexibility and
feel of a dedicated box without a lot of the hassle and expense. Some
hosting plans include preconfigured Subversion repositories nowadays,
and there are also dedicated hosted Subversion services which make it
super easy… though if you’re comfortable with installing and
configuring Apache with extra modules, you won’t find setting up
Subversion yourself against Apache difficult and then you don’t have
significant limits on the number of projects you host or the size of
your repository.

P.S., if you’re already running Apache 2.0.x for the sake of Subversion,
you can also install FCGI on it and you won’t really need to bother with
lighttpd at all unless you’re curious. Apache+FCGI performs fine. N.B.
Apache 2.1 and 2.2 are currently more difficult to get FCGI working on
in many cases.

Robert Z. wrote:

I want to be able to code my rails apps either on my Desktop mac or
my Powerbook using textmate.

I want to build a Debian server that runs lighttpd, rails and mysql.

Would I use samba on the server and access the files that way through
TextMate or is there something else that folks use? and should I
use subversion and if so, how would I do that in the scanario I’m
describing.

Basically I’m not wanting any web servers, db servers etc on the
powerbook or desktop just a copy of textmate and then access the
source on the server.

Any help or tips appreciated.

Rob

On Apr 7, 2006, at 9:53 PM, Robert Z. wrote:

Basically I’m not wanting any web servers, db servers etc on the
powerbook or desktop just a copy of textmate and then access the
source on the server.

This is really not the way to go, IMHO.

User version control.

Create a local development environment.

Nothing is better than writing some Rails code on your PowerBook with
no WiFi access.


– Tom M.

thanks. Good tips. I’ll give this a try.

Hello Robert,

2006/4/8, Robert Z. [email protected]:

thanks. Good tips. I’ll give this a try.

To put your application under version control, I would suggest reading
the primer I wrote:
http://blog.teksol.info/articles/2006/03/09/subversion-primer-for-rails-projects

Bye !