Amsterdam, Netherlands
2013
  |  By Prathamesh Sonpatki
A Rails migration is a timestamped Ruby class inheriting from ActiveRecord::Migration whose change method alters the database schema. bin/rails db:migrate runs each pending migration once, records its version in the schema_migrations table, and dumps the result to db/schema.rb. Rollbacks invert change; irreversible steps need up and down. On PostgreSQL and SQLite, each migration runs inside a transaction.
  |  By Tom de Bruijn
In Ruby, a backslash escapes the character after it. In a double-quoted string, \" inserts a quote, \\ a backslash, \n a newline, and \#{} blocks interpolation. A single-quoted string recognizes only \' and \\; every other backslash stays literal. When escaping gets noisy, switch to %q()/%Q() literals or a heredoc.
  |  By Nikola Đuza
To avoid duplicate Sidekiq jobs, you have three options: guard enqueues yourself with database flags or a queue scan, use Sidekiq Enterprise’s unique_for option, or add the free sidekiq-unique-jobs gem, which locks jobs in Redis by class and arguments. On Sidekiq 8, sidekiq-unique-jobs 8 with lock: :until_executed covers most cases.
  |  By Thomas Riboulet
RSpec is the most widely used testing framework for Ruby on Rails. With the rspec-rails gem (v8.x, supporting Rails 7.2–8.x), you write model specs for business logic, request specs for controllers and APIs, and system specs for browser flows — plus mailer and job specs. Run the suite with bundle exec rspec. In the first part of this series, we looked at the basics of RSpec and how well it works with Behavior Driven Development in Ruby.
  |  By Hans-Jörg Schnedlitz
Rails logs through Rails.logger — on Rails 8.1, a BroadcastLogger that writes tagged lines to STDOUT in production and to log/development.log in development. Six levels exist: debug, info, warn, error, fatal, and unknown; production defaults to info via RAILS_LOG_LEVEL. Good log messages are descriptive, carry context like request IDs, and become structured JSON when machines read them.
  |  By Joyce Echessa
To generate a random number in Ruby, call rand: rand(10) returns an integer from 0–9, rand(1..10) an integer from 1–10, and rand alone a float between 0.0 and 1.0. For security-sensitive values like tokens and passwords, use SecureRandom — rand is predictable. Computers cannot produce truly random numbers by computation alone. A deterministic machine can only produce pseudorandom numbers: a stream that looks random but comes from an algorithm fed with a starting value, the seed.
  |  By Kingsley Chijioke
shoulda-matchers gives you one-line RSpec and Minitest matchers for common Rails behavior — it { should validate_presence_of(:name) } replaces a hand-written validation spec. Add gem "shoulda-matchers", "~> 8.0" to your Gemfile’s test group, then add the configuration block to spec/rails_helper.rb naming your test framework and library. Version 8 works with Rails 8.1 and rspec-rails 8.
  |  By Jeff Morhous
Sidekiq is a background job framework for Ruby that processes jobs concurrently on threads, backed by Redis. In Rails, add gem "sidekiq", set config.active_job.queue_adapter = :sidekiq, enqueue with perform_async, and run the sidekiq process alongside your app server. Sidekiq 8 requires Ruby 3.2+ and Redis 7+. That answer covers the mechanics.
  |  By Brena Monteiro
To create a custom exception in Ruby, define a class that inherits from StandardError: class PaymentError < StandardError; end. Raise it with raise PaymentError, "card declined" and rescue it by class. Inherit from StandardError, not Exception, so a bare rescue still catches it. Pass a default message by overriding initialize and calling super. Ruby’s built-in exception classes describe the language’s failure modes, not your application’s.
  |  By Aestimo Kirina
Devise is a full-featured authentication gem for Ruby on Rails, built on Warden. It provides registration, login, password recovery, session timeout, and account locking via 10 composable modules. Install it with bundle add devise, then run rails g devise:install and rails g devise User. It works with Rails 7 and 8; Rails 8's built-in generator covers only simpler needs.

Made for teams that want to build high quality Ruby and Elixir applications, AppSignal offers amazing insights into errors and performance issues, plus host monitoring and an easy to use custom metrics platform.

AppSignal supports the Elixir language with an Elixir package. The package supports pure Elixir applications and frameworks including Phoenix, Plug & Erlang.

AppSignal supports the Ruby language with a Ruby gem. The gem supports many frameworks and gems including Capistrano, DataMapper, Delayed Job, Grape, MongoDB, Padrino, Rack, Rake, Resque, Ruby on Rails, Sequel, Shoryuken, Sidekiq, Sinatra & Webmachine.

AppSignal now supports Node.js! The package supports pure JavaScript applications and TypeScript applications, and can auto-instrument various frameworks and packages with optional plugins.

AppSignal also has amazing support for catching errors from Front-end JavaScript applications and sending them to AppSignal, including the React, Vue, Angular, Ember, Preact & Stimulus frameworks.

Packed with features:

  • Alerts in your tools: AppSignal integrates with Slack, Flowdock, HipChat, OpsGenie and more.
  • Control your notifications: AppSignal notifies you exactly when you want to. Get the first exceptions per deploy, all of them of never. Set thresholds for performance notifications.
  • Amazing support: We don't do "first line" and "second line" support: you get to speak with a developer, immediately.
  • Send to issue trackers: A single click creates an issue with all the necessary details in your issue tracker of choice.
  • Manage teams and users: Add users to teams and give them access to specific or all, existing and/or new applications you monitor.
  • Focus on design: Developer tools do not need to be complicated and ugly. Our interface is kept clean and easy to use.

Catch errors, track performance, monitor hosts, detect anomalies — all in one tool.