Skip to content

Instantly share code, notes, and snippets.

@mcls
Forked from jpantuso/osx_lion_rail_setup.md
Last active October 9, 2023 08:23
Show Gist options
  • Star 52 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save mcls/3118518 to your computer and use it in GitHub Desktop.
Save mcls/3118518 to your computer and use it in GitHub Desktop.
Setup mac for ruby dev

Setup new Mac from scratch

Install Xcode

Installing Xcode and the command line tools need to be done first because it installs gcc. https://developer.apple.com/xcode/features/

Or via the terminal:

xcode-select --install

Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Note that Xcode is a pre-req for Homebrew.

http://brew.sh/

https://github.com/Homebrew/homebrew/wiki/Installation

Install common tools:

brew update
brew install git vim tmux postgresql mysql tree

Set shell to ZSH and install oh-my-zsh

curl -L http://install.ohmyz.sh | sh

rbenv and ruby-build

https://github.com/sstephenson/rbenv

brew update
brew install rbenv rbenv-gem-rehash ruby-build

# Install ruby 
rbenv install 2.7.1
rbenv global 2.7.1
rbenv rehash

echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
gem update --system
gem install bundler rails --no-ri --no-rdoc

Faster gem installs

For faster gem install tell rubygems to ignore ri and rdoc creating a ~/.gemrc with:

install: --no-ri --no-rdoc
update: --no-ri --no-rdoc

Apps

Alfred

Alfred is an award-winning productivity application for Mac OS X, which aims to save you time in searching your local computer and the web.

http://www.alfredapp.com/

Dash

Awesome documentation browser.

Dash gives your Mac instant offline access to 150+ API documentation sets.

https://itunes.apple.com/us/app/dash-docs-snippets/id458034879?mt=12

http://kapeli.com/dash

iTerm2

A nice alternative to Terminal.app.

http://www.iterm2.com/

Solarized color scheme

A nice color scheme.

http://ethanschoonover.com/solarized

Pow

Pow is a zero-config Rack server for Mac OS X.

curl get.pow.cx | sh

To get it to work with Apache check: https://github.com/37signals/pow/wiki/Running-Pow-with-Apache

http://pow.cx/

VLC

VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.

http://www.videolan.org/vlc/index.html

@aalemayhu
Copy link

Good stuff, thanks for sharing 👍

@dara-icf
Copy link

This is great!

Just noticed when running that homebrew is updated.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

@mcls
Copy link
Author

mcls commented Jun 15, 2020

@DaraPressley-SAMHSA thanks, I've just updated it!

@ORESoftware
Copy link

in homebrew rbenv-gem-rehash doesn't seem to exist anymore

@ORESoftware
Copy link

also noticed:

3c22fb02d7cf:payments-service mllsaal$ gem install bundler rails --no-ri --no-rdoc
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --no-ri
3c22fb02d7cf:payments-service mllsaal$ gem install bundler rails --no-rdoc
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --no-rdoc

@einarolafs
Copy link

rbenv-gem-rehash is deprecated https://github.com/rbenv/rbenv-gem-rehash

Never run rbenv rehash again. This rbenv plugin automatically runs rbenv rehash every time you install or uninstall a gem.

This plugin is deprecated since its behavior is now included in rbenv core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment