Getting Started With Rails: Install Ruby, Rails, RSpec, Postgres, and Puma
In this article, I show you how to setup Ruby on Rails with RSpec, Postgres, and Puma
ruby-install ruby 2.3.1 --system
For simplicity I prefer to have only one version of ruby installed. 
Download Postgres.app onto your machine and follow the installation process.
gem install rails
Create a project.
rails new yourapp --database=postgresql
Enter the project.
Add puma to Gemfile and run
Finally, run the server.
bin/rails server -b 127.0.0.1 -p 3000
Add rspec-rails to Gemfile.
group :development, :test do
gem 'rspec-rails', '~> 3.0'
bin/rails generate rspec:install
rm -rf test
bundle binstubs rspec-core
Then run your tests:
You're all set. You have a good foundation for building out your Rails application.