Skip to Content
Docker for Rails Developers
book

Docker for Rails Developers

by Rob Isenberg
February 2019
Intermediate to advanced
240 pages
5h 25m
English
Pragmatic Bookshelf
Content preview from Docker for Rails Developers

Setting Up RSpec

Now that our app is configured correctly with Compose, setting up RSpec is going to be very familiar. Let’s whiz through this quickly.

Following the instructions from rspec-rails,[41] we need to add the following to our Gemfile:

 group ​:development​, ​:test​ ​do
 # Call 'byebug' anywhere in the code to stop execution and get a debugger…
  gem ​'byebug'​, ​platforms: ​[​:mri​, ​:mingw​, ​:x64_mingw​]
» gem ​'rspec-rails'​, ​'~> 3.8'
 end

First, let’s stop our web service:

 $ ​​docker-compose​​ ​​stop​​ ​​web

Next, we need to rebuild our image to run bundle install, and then create a new container from it:

 $ ​​docker-compose​​ ​​build​​ ​​web
 Building web
 Step 1/12 : FROM ruby:2.6
 ...
 Step 7/12 : RUN apt-get update ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Adam Notodikromo
Mastering Ruby Closures

Mastering Ruby Closures

Benjamin Tan Wei Hao

Publisher Resources

ISBN: 9781680506730Errata Page