scribble

The Flying Developer

Home About Me

11 Aug 2014
Gems You Shouldn't Leave Development Without

A couple of weeks ago I gave a talk at Ottawa Ruby called ‘Gems you Shouldn’t Leave Development Without’.

You can find the video and slides below, as well as notes adapted from the slides:

Development Gems!

Makes assets shut the hell up in development.

Adds a much better error page for development.

Also a REPL if you add binding_of_caller too!

Pry is a great alternative to IRB.

Pry-debugger adds your favourite debug commands:

  • step
  • next
  • continue
  • finish

Allows you to set breakpoints too.

OK, Let’s Talk Production

Environment Management

Figaro is a rails-specific environment management gem.

Dotenv is similar to Figaro but works with any rack-based ruby app.

Error Reporting

Dirt simple error notification. Send errors by email, or to another service (e.g. group chat) using various adapters.

Exception Notification Services

  • Airbrake
  • Errbit
  • Honeybadger
  • Rollbar
  • Lots more

Ruby Toolbox has a great list: https://www.ruby-toolbox.com/categories/exception_notification

Application Server

  • WEBrick
  • Thin
  • Unicorn
  • Passenger
  • Puma

Go with Unicorn unless you have a reason not to.

Don’t use WEBrick in production.

How About… Middleware!

Redirect all requests to a specific host. Can also be used to force SSL. Great for custom domains on Heroku.

Supports tons of options including regex matching on host strings.

Connection whitelists, blacklists, and throttling. Stops misbehaving clients from even hitting your app code.

Works well with Fail2Ban blacklists and others.

Adds an analytics code to every page of your app.

Heroku

Tells Rails to serve assets. This is usually delegated to the routing webserver (e.g. nginx or apache).

Redirects logs to stdout rather than logfiles.

Stops Heroku complaining every time you deploy.


Thanks for reading! If you like my writing, you may be interested in my book: Healthy Webhook Consumption with Rails

David at 11:00

scribble

Home About Me