bugstack for Ruby & Rails
The bugstack SDK captures uncaught server errors in Rails and starts a fix: NoMethodError nil:NilClass, ActiveRecord::RecordNotFound, and nil-related errors. It is the crash-capture part of a product that maintains your whole repository.
What Ruby Errors bugstack Fixes
- NoMethodError: undefined method for nil:NilClass — calling methods on nil objects
- ActiveRecord::RecordNotFound — querying for records that don't exist
- ArgumentError: wrong number of arguments — method arity mismatches
- NameError: uninitialized constant — referencing undefined classes or modules
Install the SDK
Add bugstack to your Gemfile:
gem install bugstack
Or add it to your Gemfile and bundle:
# Gemfile
gem 'bugstack'
bundle install
Then initialize it in an initializer:
# config/initializers/bugstack.rb
Bugstack.configure do |config|
config.api_key = ENV["BUGSTACK_API_KEY"]
end
Example Fix
bugstack detects a NoMethodError caused by calling a method on nil and writes a small fix:
def show
@user = User.find_by(id: params[:id])
@email = @user.email
end
# Runtime error when user is nil:
# NoMethodError: undefined method
# 'email' for nil:NilClass
def show
@user = User.find_by(id: params[:id])
if @user.nil?
head :not_found
return
end
@email = @user.email
end
What else bugstack does for this repository
The SDK is one part. Once your repository is connected, bugstack also scans your Ruby gems for known vulnerabilities and outdated versions, scans for secrets, and acts on failed deploys if you host on Render. It scans and reports, and it can open pull requests for what it finds. Those pull requests are switched on per account. Every change arrives as a pull request, and you set how much happens without you.
Related Error Guides
Full installation guide with config reference →
Hand off the upkeep of your Ruby app
bugstack captures uncaught server errors in production, finds the cause, writes the fix, and opens a pull request in minutes. Your CI runs on every change, and you decide how much happens without you.
Get started with your Ruby appConnect GitHub. Add the SDK. That's the setup.