Recently we've been presenting articles about development environments, for Linux, Windows, Mac and the Cloud. In this article, Shaumik looks at moving from one to another.

Ubuntu to OS X

Last year, I got myself a Macbook Air for two reasons: a powerful terminal and popular graphics software. I thought the transition would be smooth; but only when I started the process did I realize the complexity of the task.

SitePoint recently published articles on setting up a development machine on Ubuntu and setting up a development machine on a Mac. In this post, I'll look at the subtle differences you might face when shifting your development environment from Ubuntu to OS X, or vice versa.

General Procedure for Installing Software

Let's first talk about what you can expect on OS X if you're used to Ubuntu.

OS X, owing to its high market share, has a large developer base. Therefore, almost all pieces of software have an OS X installer. How you install them is interesting. An installer usually walks you through the installation (much like an installation wizard on Windows). Some packages might be available in the form of .dmg files, which are none other than compressed files. You need to move the extracted application to the Applications directory. Removing such packages just requires removal from the Applications directory. Here's a guide on installing downloaded software on a Mac.

App Store app on Mac Alternatively, the installation of applications might also be done through the App Store. However, not all applications are available there. Those that aren't — such as browsers like Chrome and Firefox, and text editors like Sublime Text — are easily downloaded from their respective websites and installed as described above.

The Terminal

Terminal on a Mac

Terminal on a Mac

In the terminal, most commands are similar (except those that are specifically package related). For instance, running the grep command to search for a phrase is exactly the same.

However, if you're interested in developing scripts that run across platforms (including old Mac versions), you may find this guide by Apple developers interesting.

Further, for the list of subtle differences in commands, visit A Sysadmin's Unixersal Translator, by Rosetta Stone, and select OS X and Linux from the list of operating systems on the top left corner. From the list, you can see that the usage of most commonly used commands is the same.

Homebrew: the Package Manager for Mac

Ubuntu has apt-get as a package manager, whereas Fedora has yum.

Unfortunately, there's no default package manager for Mac that magically installs every new piece of software you might wish to have. Although there are many alternatives like MacPorts and Fink, the best package manager for Mac is probably Homebrew. In case you're interested, here's a comparison between the three options.

Installing Homebrew is easy: you just need to run a single command, as mentioned on their website:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The installation script is in Ruby. Ruby comes pre-installed on a Mac. During installation on a fresh machine, you're prompted to install components of XCode Command Line Tools, which you need to approve. To verify that Homebrew has been installed, you can run brew info.

Installing packages through Homebrew is similar to other package managers. Homebrew installs packages for the local user, and therefore doesn't require any root privileges. We'll look at the process of installing packages on Homebrew later in this post. Meanwhile, make sure Homebrew is updated by running the following commands:

brew update
brew doctor
brew upgrade

Version Control

Using SourceTree on a Mac

Using SourceTree on a Mac

Almost all developers today — especially those working in teams — need to use version control to collaborate. The most popular version control tool is Git, although many prefer Mercurial or Subversion.

Matthew explained his choices for version control in his post, such as GUI tools like SourceTree or GitX. These GUI tools come with their own version of Git. SourceTree supports both Git and Mercurial.

If you prefer using version control through the command line, you need to install your version control system separately. Git has a package for Mac, but if you need the latest development version, you'll have to build from the source.

Note: if there's a separate version of Git/Mercurial present in your system when you install SourceTree, you'll be asked whether you want to use the version in your system or the version bundled with SourceTree.

Continue reading %Shifting Your Development Environment from Ubuntu to OS X%

Source: http://www.sitepoint.com/feed/