Installation

    Install ActiveRabbit using RubyGems or from source.

    RubyGems (Recommended)

    The simplest way to install ActiveRabbit is via RubyGems:

    # Add to your Gemfile
    gem 'activerabbit-ai'
    
    # Then run
    bundle install

    Or install it directly:

    gem install activerabbit-ai

    From Source

    To install from the latest source code:

    git clone https://github.com/activerabbit-ai/activerabbit.git
    cd activerabbit
    bundle install
    rake install

    Version Requirements

    DependencyMinimum VersionRecommended
    Ruby2.73.2+
    Rails6.07.0+
    Bundler2.02.4+

    Framework Integration

    Ruby on Rails

    ActiveRabbit automatically integrates with Rails when the gem is loaded. No additional configuration is required for basic error tracking.

    The gem automatically:

    • Installs exception handling middleware
    • Captures unhandled exceptions
    • Adds request context (URL, params, headers)
    • Integrates with Active Record for query tracking

    Sinatra

    For Sinatra applications, add the middleware manually:

    require 'activerabbit'
    require 'sinatra'
    
    ActiveRabbit.configure do |config|
      config.api_key = ENV['ACTIVERABBIT_API_KEY']
    end
    
    use ActiveRabbit::Rack::Middleware
    
    get '/' do
      'Hello World!'
    end

    Plain Ruby

    For plain Ruby applications:

    require 'activerabbit'
    
    ActiveRabbit.configure do |config|
      config.api_key = ENV['ACTIVERABBIT_API_KEY']
    end
    
    begin
      # Your code here
      do_something_risky
    rescue => e
      ActiveRabbit.capture_exception(e)
      raise
    end

    Verifying Installation

    After installation, verify everything is working:

    # Start Rails console
    rails console
    
    # Check if ActiveRabbit is loaded
    ActiveRabbit.configured?
    # => true
    
    # Send a test message
    ActiveRabbit.capture_message("Installation test!")
    # => #<ActiveRabbit::Event:0x...>

    Visit your ActiveRabbit dashboard to confirm the test message was received.

    Troubleshooting

    Gem not found

    If you get a "could not find gem" error:

    # Clear bundler cache
    bundle clean --force
    bundle install

    API key not configured

    If you see "API key not configured" errors:

    # Verify your environment variable
    puts ENV['ACTIVERABBIT_API_KEY']
    # Should output your API key
    
    # Or set it directly in the initializer (not recommended for production)
    ActiveRabbit.configure do |config|
      config.api_key = 'your_api_key_here'
    end

    SSL Certificate Errors

    If you encounter SSL errors, ensure your system certificates are up to date:

    # macOS
    brew install openssl
    brew install ca-certificates
    
    # Ubuntu/Debian
    sudo apt-get update
    sudo apt-get install ca-certificates

    Need Help?

    If you're still having issues, check our GitHub Issues or reach out to support at [email protected]