Install Ruby on Rails on Mac

Please follow the below steps to install RVM RUBY RAILS and Postgres in MAC yosemite.

Step 1. Install Homebrew

Homebrew is a package manager for the Mac. Installing Homebrew by issuing the following command:


To make sure Homebrew is installed correctly run:
brew doctor

Step 2: Install GPG Package.

Download and install the GPG package from the link

Step 3: Install RVM

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

and

\curl -sSL https://get.rvm.io | bash -s stable

Reload your bash_profile, so it can initialize RVM.

~/.bashrc

Run RVM requirements to install basic required packages with Homebrew. Accept the license agreement and install Xcode Tools. After installing the tools continue the rvm requirements installation.

rvm requirements

Step 4. Install Required Ruby

Install required ruby version. You can call ‘rvm list known’ for all available rvm environments.

rvm install ruby-head

If you face any issue like

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

1    1) edit and add [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" to .bash_profile file

2) Restart terminal and try RVM command again

Step 5: Install Git
Git a version control system, which can be used to control your code repository.

brew install git

Step 6: Install rails
gem install rails

Step 7: Install PostgreSQL
brew install postgresql

To have launchd start postgresql at login:

ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents

Then to load postgresql now:

Launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Create a database with your username
createdb

Login to PostgreSQL
psql

That's it we are done with our installation  process :). 

Comments

Post a Comment

Popular posts from this blog

Debug Nodejs inside docker container

Swap primary keys between two records in the same table in Postgres

How to add a bootstrap table with fixed header and scrollable body