views:

153

answers:

3

So far I have been building my Rail app on a Mac OS X box using TextMate.

It's just me, so I haven't used Git. I have just opened and closed the code in the file system, used an AppleScript to take annotated snapshots at key moments, and let Time Machine take care of the rest.

I've just ordered a Windows laptop which I'll use for the same project. I'm hoping to sync everything automatically between the two computers.

I'm assuming I can sync the project itself using Git, Mercurial or SVN. (Regardless, I'd have to teach myself version control.) It would be nice to do this syncing via a server that provided free accounts for small private projects. It would also be nice if I could continue to use standard Open and Save dialogues in Mac OS X and Windows at the start and end of each chunk of work, instead of mucking around with version control commands. Any thoughts on how to make this is simple as possible?

Beyond that I'll have to sync the Rails version, the Ruby version, the available gems, and the available libraries like ImageMagick. Some of this I guess I can achieve by specifying the Rails version etc in various config files. Again, any thoughts?

If it was just you, a Mac and PC, what would be your ideal approach?

+1  A: 

I really suggest opening a free account at Github.com and teaching yourself git. Learning the command line does not take long and once you start using it you can understand why the command line persists to this day.

Also, though I have not used it, there appears to be a good Git bundle for TextMate here: http://gitorious.org/git-tmbundle

sosborn
I presumed Git was for syncing application code, not the supporting libraries, gems, etc. Was I wrong?
steven_noble
If you freeze your gems as described here: http://gemsonrails.rubyforge.org/you can then have your gems in your version control scheme.Personally though I avoid freezing gems until I am at a point where I am almost ready for deployment.By the way, this is exactly the strategy I am using for personal projects on a Mac and PC. Version control can be intimidating at first, but just like coding, once you start using it you will see that it is really quite simple, and even more importantly, it will save your bacon at some point in time.
sosborn
A: 

I agree that GIT is a great way to manage the versioning, but another way is to use a virtual machine. This means that you create your development environment under Ubuntu under VMWare or VirtualBox, and then copy the virtual image from one machine to another. This way you don't have to set everything up twice for the different operating systems, which can be a real pain. Using this technique means everything works the same under the Mac and Windows, and if you only have source code changes then you can still use GIT to keep the images up to date.

Zubair
A: 

Quite frankly there is no particularly easy way to achieve what you're after. Gems and libraries that need compiling, for instance, just can't be mirrored to another machine, especially a different OS.

However, I can provide you with an easier way to manage your projects if you don't want the hassle of Version control, which is DropBox. I'm using it for one of my rails projects at the moment. Once you install the software, it creates a 'dropbox' folder on your machine. Any time you save a file into it, or update a file already in it, it's instantly uploaded to their free server, securely, and then downloaded onto each machine that have the software installed. This allows you to continue using the Open and Save dialogues you're used to while also keeping a history of each update you make to the server.

It is not an answer to Version Control, and it really isn't meant to be. Git and Mercurial are still worth learning, but it's a good middle ground and perfect when you don't need so much control. It's worth a look, even just for general backup.

P.S. I don't work for dropbox, i just love it.

gablaxian
Very cool. Thanks.BTW, a gem-syncing gem sounds like a nice idea?And I'm assuming I just fish around in various config files to have my app always use the same version of Rails and Ruby regardless of what's installed locally?
steven_noble
in the environment.rb file you can specify which rails version you want that app to use, and you can also specify a rails version when installing it onto a machine, like rails install --version=2.3.4 (or something to that effect) so yes, you can easily make each machine always use the same version anyway.
gablaxian