The purpose of this step by step tutorial is to provide a very simple example of configuring a minimal Rails environment.
- macOS 10.12.4 or later
- download and install Xcode from Mac App Store
- from the Terminal.app, install command line tools
$ xcode-select --install
- download and install MacPorts for OS X
- download and install Node
-
open Disk Utility, select MacIntosh HD, click Repair Disk Permissions
-
open the Terminal.app
-
clone this repository
$ git clone https://github.com/conradwt/rails-setup-guide-for-macos
- change directory to the cloned repository
$ cd path/rails-setup-guide-for-macos
- remove existing
$ mv ~/.bashrc ~/.bashrc.orig
$ mv ~/.bash_login ~/.bash_login.orig
$ mv ~/.bash_profile ~/.bash_profile.orig
$ mv ~/.profile ~/.profile.orig
$ mv ~/.zshrc ~/.zshrc.orig
Note: Some or most of the above files may not exist. Thus, if you get the following error it's OK:
e.g. mv: rename .bashrc to .bashrc.orig: No such file or directory
- configure the .profile
$ cp sample.profile $HOME/.profile
$ . ~/.profile
Note: If you see the following message,
**-bash: rbenv: command not found**
please continue to the next step.
- set the Git completion
$ cp sample.git-completion.sh $HOME/.git-completion.sh
- install required ports from MacPorts
$ chmod +x install-ports.sh
$ ./install-ports.sh
- install RBenv
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
- install all of the approved plugins RBenv plugins
$ chmod +x install-rbenv-plugins.sh
$ ./install-rbenv-plugins.sh
- install Ruby 2.3.3
$ rbenv install 2.3.3
$ rbenv global 2.3.3
- install Ruby on Rails web development framework
$ gem install bundler
$ gem install rails
$ rbenv rehash
- install Heroku Toolbelt
-
open Disk Utility, select MacIntosh HD, click Repair Disk Permissions
-
set the terminal
$ cp sample.terminal $HOME/.
- from the terminal menu, Shell -> Import, select sample.terminal file
Terminal -> Preferences -> Settings, click the 'sample' profile on the left, click Default
- create a Github.com account
Note: Skip this step if you already have an account.
- create Git configuration file
$ cp sample.gitconfig ~/.gitconfig
- edit the Git configuration file
$ atom ~/.gitconfig
Note: atom
editor is being used but you can use any editor to make the
modifications to the .gitconfig
file.
change the text on the right side of the equal:
name = <your firstname lastname>
email = <your e-mail address>
to the text for your name
and e-mail
that you're using for Github.com:
e.g.
name = John Doe
email = john.doe@example.com
- set up PostgreSQL Server
$ sudo mkdir -p /opt/local/var/db/postgresql96/defaultdb
$ sudo chown postgres:postgres /opt/local/var/db/postgresql96/defaultdb
$ sudo su postgres -c '/opt/local/lib/postgresql96/bin/initdb -D /opt/local/var/db/postgresql96/defaultdb'
- set PostgreSQL 96 as the default version
$ sudo port select postgresql postgresql96
- start the PostgreSQL 96 Server
$ pgstart
$ = stuff that you type in the terminal
Bug reports and feature requests can be filed for the project here:
Follow Conrad Taylor on Twitter (@conradwt)
This repository is released under the MIT License.
© Copyright 2014 - 2017 Conrad Taylor. All Rights Reserved.