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

Install Ruby

ruby-install ruby 2.3.1 --system

For simplicity I prefer to have only one version of ruby installed. [1]

Install Postgres

Download onto your machine and follow the installation process.

Install Rails

gem install rails

Create a project.

rails new yourapp --database=postgresql

Enter the project.

cd yourapp
bin/rake db:create

Install Puma

Add puma to Gemfile and run bundle install.

gem 'puma'

Finally, run the server.

bin/rails server -b -p 3000

Visit http://localhost:3000

Install RSpec

Add rspec-rails to Gemfile.

group :development, :test do
  gem 'rspec-rails', '~> 3.0'


bundle install
bin/rails generate rspec:install
rm -rf test
bundle binstubs rspec-core

Then run your tests:


That's it!

You're all set. You have a good foundation for building out your Rails application.