Web Development Stack In OSX
It has been almost a month since I ventured out into contracting and took up OSX on a Macbook Pro as my primary operating system. In that time, I’ve been very fortunate to have Joey Beninghove guide me through the torrent of options and possibilities for building web apps in OSX. I’ve thrown in a few of my own tools based on all the things I’m doing and my own personal experience, too. Most of these tools are available to other platforms, too. You don’t have to be a OSX user to take advantage of them, but it certainly seems to be easy if you are.
Here’s what I’ve settled on, so far, creating an awesome development experience – far better than any IDE I’ve ever used.
At the root of it all is the OSX Terminal. I’m using the standard Bash shell at this point, though a number of people have told me I need to try out ZSH. I’ll probably get around to that eventually. For now, though, Terminal handles my needs quite nicely.
I’ve already talked about my terminal prompt. Joey has also talked about setting up window groups to auto-start the various components of a project. It works out well – only requires one menu option to launch all of the core services of a project.
I don’t like installing things manually. Linux has the wonder packages managers, and OSX has a few options, too. The choice of Homebrew vs. Macports wasn’t too hard, really. I’ve used Macports in the past and it was… usable. I went with Homebrew at the suggestion of several people and it’s been quite nice in comparison to Macports. The commands seem to be easier and more friendly to work with.
Installed via Homebrew
brew install git
The only source control I love, at this point. I’m sure that will change once the next new hotness comes down the line… but for today (and the last 2 years), Git is where it’s at for me.
Installed via Homebrew
brew install macvim
Ah, vim. It’s the most difficult “text editor” I’ve ever used and the most amazing code editor I’ve ever fell in love with. After many months of working with vim and vim-like plugins for other editors, I can’t imagine using anything that doesn’t have vim’s core editing features.
… and the many, many plugins available make automating most tasks that you would want from an IDE, extremely simple. Here’s the plugins that I use:
- twilight (color theme)
Of course, there are countless others available.
RVM (Ruby Version Manager)
If you do any work with ruby on OSX or Linux, you need to be using RVM. It allows you to easily switch between different versions of ruby, install new versions of ruby, and manage your gems for specific projects with gem sets. The best part is, you can automate rvm usage by putting a .rvm file in a folder. When you cd into that folder in terminal, rvm will read the file and automatically set the correct version of ruby and the gem set that you want to use for that project.
Ruby On Rails
The de-facto standard in MVC web frameworks, these days. Here’s a few of the plugins that Joey and I are currently using with Rails:
These, combined with other misc items and Rails itself, make the web development story very nice.
Installed from Homebrew
brew install mongodb
The Rails drive that Joey and I are using is Mongoid. It handles most of our needs without any effort. The few things it doesn’t handle are easy to do on our own.
Yes, I am doing more than just Rails work. I’m also working on some WordPress sites – mostly converting existing sites to WordPress, including the creation of themes, etc.
If you’re doing any WordPress work, or any web work that involves Apache, MySql, PHP or Perl, then you need to be using XAMPP. This goes for OSX, Linux, and Windows. XAMPP is, in a nutshell, a complete package for web development in the xAMPP stack (hence, the name). You don’t need to install or configure any of these tools on your machine, with XAMPP. It is an isolated install of them, providing a clean separation between your machine and the web development stack.
This is probably my favorite new tool out of all of these tools. Not only is the technology behind it really really cool – EventMachine and websockets – but what it does is amazing.
This tool monitors your file system and watches for changes to your web app’s files – ruby code, php code, css, html, you name it and LiveReload will monitor it. Just set what you want to watch in a .livereload file in your project folder. When any changes to the watched files are found, your browser (Safari or Chrome) will automatically reload the page that you are looking at!
What this means, in practice, is that you no longer have to do the save-switch-refresh dance when you are building html and css – or writing code in your controllers or WordPress themes! You can have your browser window set on the page you are editing / styling, enable livereload for the page, and then switch over to your editor of choice. When you make some changes and save the file(s), your browser will refresh the page for you and you will see the changes immediately! No more “save”, “switch to the browser”, “hit refresh”, “switch back to the code editor”. Just save and see your changes.
More Than Just This List
Of course there are fare more tools and add-ons that I am using, than this list. I’ve only touched on the big name tools that give me the most bang for the buck. Beyond this, the tools get much more specialized and specific to the app that I’m building at any given point in time.