Most developers like to spend a bit of time setting up their development workspace. I’m no different, after a number of years tweaking and experimenting the following article details how I setup my environment for Mavericks/Yosemite. There has always been a consistent criteria my development environment needed to meet:. Unobtrusive, no modifying core files.
Setting Up Your Development Workspace (specifically For Mac)
Flexibility with Ruby versions. Minimal configuration. Easy to setup new/existing projects So if you’re a Ruby developer with the same ideals this should help you get started quickly. This article assumes a clean install of Mac OS X Mavericks/Yosemite but I’ve added notes for Mountain Lion and those stuck on Lion should also be able to follow along.
The Essentials Install Homebrew If you’ve not used before you’re going to love it. The self proclaimed missing package manager for OS X allows us to easily install the stuff we need that Apple doesn’t include. Installation is simple, open Terminal (Applications » Utilities » Terminal) and copy this command.
Brew install rbenv ruby-build rbenv-gem-rehash echo 'eval '$(rbenv init -)' /.bashprofile source /.bashprofile Now close terminal and open it again, this ensure everything has been reloaded in your shell. The package we just installed allow us to install different versions of Ruby and specify which version to use on a per project basis and globally. This is very useful to keep a consistent development environment if you need to work in a particular Ruby version. We’re going to install the latest stable of Ruby (at the time of writing) you can find this out by visiting the.
Or to see a list of all available versions to install rbenv install -list. Echo 'gem: -no-document n ' /.gemrc That’s all, as you’ll see from rbenv install -list there are loads of Ruby versions available including.
You will need to re-install any gems for each version as they are not shared. Install Ruby on Rails So far you’ve installed Ruby, if you’re not going to be working with Rails you can pat yourself on the back and start working with Ruby! If you intend to work with Rails then you’ve just got a couple more things to do. Install SQLite3 SQLite is lightweight SQL service and handy to have installed since Rails defaults to using it with new projects. You may find OS X already provides an (older) version of SQLite3, but in the interests of being thorough we’ll install it anyway as Homebrew will set it to ‘keg-only’ and not interfere with the system version if that is the case. Installation is simple with Homebrew: ( are you loving Homebrew yet!?).
Setting Up Your Development Workspace (specifically For Mac Free
Brew install git What about the kitchen sink? That’s all you need for most Ruby on Rails applications. It has been serving me pretty well and meets all the requirements I outlined at the beginning of the article. An alternative to rbenv is the idea behind them both is the same but I find working with rbenv more comfortable but that maybe because I haven’t spent much time with rvm. If you’re just starting out don’t worry there’s a lot to take in, start off with this setup and you’ll find your sweet spot as you get more experienced.
Setting Up Your Development Workspace (specifically For Mac Download
Further reading for Ruby on Rails If you’re looking for some further reading to improve your knowledge of Rails and Ruby here are a couple of places to take a look (in no particular order):., you can’t beat the documentation!., always handy to have this bookmarked., brilliant Ruby course using videos, quizzes and challenges to help you learn. Also offers courses on many other languages., superb website operated by the talented loads of screencasts on a range of topics in the Rails world. Worth the $9 a month subscription for the Pro episodes., operated by this is focused on Ruby but if you’re new to Ruby it’s definitely worth a look., available in various formats this is another great book to guide you through working with Rails. Written by on Feb 02, 2014 ( Updated on Mar 21, 2016).