Gems every Rails and Ruby project should use

Image for post
Image for post
Photo by Don Agnello from Unsplash

TLDR

pry-byebug
rspec (or rspec-rails for Rails)
rubocop (or rubocop-rails for Rails)

TSPE

RuboCop

👉 For consistency and linting

# Show files that are violating rules
> bundle exec rubocop --color --force-exclusion --format simple
# Show files that are violating rules and auto-correct
> bundle exec rubocop --color --force-exclusion --format simple --auto-correct
# Generate "TODO" list of files that break rules
> bundle exec rubocop --auto-gen-config
Image for post
Image for post
Does anybody else feel weirdly satisfied after auto-correcting their projects with RuboCop?

RSpec

👉 For testing

Image for post
Image for post
Example RSpec test

Pry-Byebug

👉 For debugging

binding.pry
Image for post
Image for post
Sample debugging session

Other 👌 gems

factory_bot_rails ⟶ Generating model records in Rails
faker ⟶ Creating fake data (ex. Faker::Hacker.say_something_smart)
httparty ⟶ Make HTTP requests

Written by

She / Her ✦ Software engineer at Loom, previously at Gusto ✦ juliannaroen.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store