Aug 26 2009

New Git Documentation

We have created a new guide on using Git with your OCS Solutions hosting account on our support wiki.  This guide gives assistance with creating, managing, and updating Git repositories on your hosting account.

It provides a practical example on how to use Git to manage your website hosting files.  You can use Git to manage the files in your ~/public_html folder for PHP and HTML-based sites, or your ~/rails_apps/yourapp folder if you have a Rails-based site.  Also included are instructions on hiding your .git folder from prying eyes if you use it to manage your website, enhancing your site security.

The advantages that Git has over Subversion are that it is typically faster to use, uses less network bandwidth when transferring data from one repository to another, and its decentralized, meaning branching is easier and you don’t have to rely on a central server for updates.  I personally find Git a better overall experience than Subversion because of the way the entire repository sits on your computer and on other locations your code exists, providing complete redundancy and easier portability for coding on the go.

If you haven’t given our Git support a try, we encourage you to.  You can learn more about Git at the official Git website.


Apr 7 2009

My Perfect Rails Development Environment in Windows

The Problem

I normally do most of my Rails development in Linux, but I do have a Windows development environment setup as well, because most of my non-development time is spent in Windows and I like being able to quickly work on a Rails project without having to switch to my Linux machine.

The problem though with Rails development on Windows is two-fold:

  1. Ruby and Rails do not cooperate with Windows as well as they should sometimes
  2. Microsoft doesn’t cooperate with UNIX well at all

So rather than try and lay blame as to who’s fault this is, I’ve developed a workaround work flow that works quite nicely.

Software I Use

To make Rails development easier in Windows, I use:

  • The E – TextEditor
  • Cygwin (installed at first by e, but customized later on by me)
  • puttycyg (because Windows console windows suck)

Installing the Environment

I recommend removing Ruby for Windows (the one-click installer variety) before you get started.  It will make things a lot easier for you down the road, and unless you’re doing Ruby for Windows applications development, you won’t need it.  I also recommend uninstalling Cygwin as well if you have installed it previously, because the e will automatically setup Cygwin for you with some pretty good defaults.

Download a trial of the E – TextEditor and install it.  When you first run it, it will want to install Cygwin.  Let it do so.  Pick Manual if you want to customize the software.  You can choose Automatic though and be just  fine, because you can always rerun the Cygwin setup (by going to the Cygwin website and downloading their installer) and add or update features later.  If you choose the manual method, it would be a good idea to include Subversion, Git, and perhaps other languages like Python and a C compiler to enable you to use other UNIX software inside your Cygwin installation.

Once you’ve done this, you’re almost ready to go.  If you like the Windows console, then you can stop here – but I don’t.  That’s where puttycyg comes in.   It’s basically a modified PuTTY version that works with Cygwin.  Using this program you can connect to your Cygwin instance, but having all the options of display and scrollback that come with PuTTY.  Let’s face it, being limited to 2 fonts in the Windows console really isn’t fun.  I’m still amazed Microsoft hasn’t fixed this.

Once you’ve done this, you can pretty much proceed with development of Rails application using the same commands you would on a Linux or Mac machine (well, at least with 99% compatibility).  You can even access your Windows drives with the /cygdrive/c (replace c with the drive you want to use) path in Cygwin.

Conclusion

While this isn’t the most ideal setup, it works well for most things, and enables you to use Capistrano deployments much more easily than you can in Windows.  Git’s native Windows version has a long way to go, and thus the Cygwin near-native UNIX version of Git makes using Git under Windows a far more productive task.

In this guide I’m using the E – TextEditor.  You could replace this with any other editor that you like and achieve similiar results.  You can even use Vim or Emacs inside Cygwin.  Either way, I still recommend using Cygwin, because the native Windows Ruby interpreter and Rails support for Windows will cause you problems down the road.


Nov 20 2008

Improved OCS Support Wiki Layout

We have improved the layout of our OCS Support Wiki, particularly on the front page.  Information is better categorized and more easily visible.    We have also removed some redundant and conflicting information in articles and updated some of them to reflect recent improvements.

We are always adding new information and articles to our wiki, so check back often for the latest updates.