This guide covers the most common errors encountered during Chatwoot development setup and their solutions. Use this as a quick reference when troubleshooting issues.
# Install PostgreSQL development packagessudo yum install postgresql-devel# Install development toolssudo yum groupinstall "Development Tools"# Retry bundle installbundle install
Ruby version mismatch
Error Message:
Your Ruby version is 3.1.0, but your Gemfile specified 3.3.3
Cause: Wrong Ruby version installed.Solutions:
rbenv
RVM
asdf
# Install correct Ruby versionrbenv install 3.3.3# Set as global versionrbenv global 3.3.3# Verify versionruby --version# Rehash to update shimsrbenv rehash
# Install correct Ruby versionrvm install 3.3.3# Use the versionrvm use 3.3.3 --default# Verify versionruby --version
# Install correct Ruby versionasdf install ruby 3.3.3# Set as global versionasdf global ruby 3.3.3# Verify versionruby --version
Bundler version conflicts
Error Message:
Bundler could not find compatible versions for gem "bundler"
Cause: Incompatible Bundler version.Solution:
# Check current Bundler versionbundler --version# Install specific Bundler version (check Gemfile.lock)gem install bundler:2.4.22# Update Bundlergem update bundler# Clean bundle cachebundle clean --force# Retry installationbundle install
# Install correct Node.js versionasdf install nodejs 20.10.0# Set as global versionasdf global nodejs 20.10.0# Verify versionnode --version
pnpm installation issues
Error Message:
pnpm: command not found
Cause: pnpm not installed.Solutions:
# Install pnpm globallynpm install -g pnpm# Or using corepack (Node.js 16.10+)corepack enablecorepack prepare pnpm@latest --activate# Or using Homebrew (macOS)brew install pnpm# Verify installationpnpm --version
Package installation failures
Error Message:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
Cause: Peer dependency conflicts or corrupted cache.Solutions:
# Clear pnpm cachepnpm store prune# Remove node_modules and lock filerm -rf node_modules pnpm-lock.yaml# Reinstall with legacy peer depspnpm install --legacy-peer-deps# Or force installationpnpm install --force# Alternative: use npmnpm install
Address already in use - bind(2) for "127.0.0.1" port 3000
Cause: Another process is using port 3000.Solutions:
# Find process using port 3000lsof -ti:3000# Kill the processkill -9 $(lsof -ti:3000)# Or use a different portbundle exec rails server -p 3001# Check what's running on the portnetstat -tulpn | grep :3000
Secret key base missing
Error Message:
ArgumentError: Missing `secret_key_base` for 'development' environment
Cause: SECRET_KEY_BASE not set in environment.Solution:
# Generate a new secret keybundle exec rails secret# Add to .env fileecho "SECRET_KEY_BASE=$(bundle exec rails secret)" >> .env# Or set temporarilyexport SECRET_KEY_BASE=$(bundle exec rails secret)bundle exec rails server
Cause: Webpack assets not compiled or compilation failed.Solutions:
# Check if webpack dev server is runningps aux | grep webpack# Start webpack dev serverpnpm run dev# Or compile assets manuallybundle exec rails assets:precompile# Clear webpack cacherm -rf tmp/cache/webpackerrm -rf public/packs# Reinstall node modulesrm -rf node_modulespnpm install
# Clear Spring cachebundle exec spring stop# Restart test suitebundle exec rspec# Check for duplicate factory definitionsgrep -r "FactoryBot.define" spec/
Capybara/Selenium errors
Error Message:
Selenium::WebDriver::Error::WebDriverError: unable to connect to chromedriver
Cause: ChromeDriver not installed or incompatible version.Solutions:
# Install ChromeDriver# macOSbrew install chromedriver# Ubuntu/Debiansudo apt-get install chromium-chromedriver# Or use webdrivers gem (should be automatic)bundle exec rails runner "Webdrivers::Chromedriver.update"# Run tests in headless modeHEADLESS=true bundle exec rspec spec/system/
Cause: Large codebase, slow database, or memory issues.Solutions:
# Use Spring for faster Rails commandsbundle exec spring binstub --all# Check Spring statusbundle exec spring status# Restart Spring if neededbundle exec spring stop# Increase memory if neededexport RUBY_GC_HEAP_INIT_SLOTS=10000export RUBY_GC_HEAP_FREE_SLOTS=10000# Profile startup timetime bundle exec rails runner "puts 'Rails loaded'"
Slow test suite
Cause: Database setup, factory creation, or inefficient tests.Solutions:
# Use parallel testingbundle exec rspec --parallel# Profile slow testsbundle exec rspec --profile# Use database cleaner strategies# Add to spec/rails_helper.rb:# config.use_transactional_fixtures = true# Optimize factories# Use build_stubbed instead of create when possible
Cause: SMTP configuration or email service issues.Solutions:
MailHog
Letter Opener
Gmail SMTP
# Install and start MailHogbrew install mailhog # macOSmailhog# Configure .envMAILER_SENDER_EMAIL=dev@chatwoot.localSMTP_ADDRESS=localhostSMTP_PORT=1025# Check web interfaceopen http://localhost:8025
# Add to Gemfileecho 'gem "letter_opener", group: :development' >> Gemfilebundle install# Configure in development.rb# config.action_mailer.delivery_method = :letter_opener# Emails will open in browser
# Use app password, not regular passwordMAILER_SENDER_EMAIL=your-email@gmail.comSMTP_ADDRESS=smtp.gmail.comSMTP_PORT=587SMTP_USERNAME=your-email@gmail.comSMTP_PASSWORD=your-app-passwordSMTP_DOMAIN=gmail.comSMTP_ENABLE_STARTTLS_AUTO=true
Error: Real-time features not working, WebSocket connection failed.Solutions:
# Check if ActionCable is mountedgrep -r "mount ActionCable" config/routes.rb# Check Redis connectionredis-cli ping# Configure ActionCable for development# In config/environments/development.rb:# config.action_cable.url = "ws://localhost:3000/cable"# config.action_cable.allowed_request_origins = ["http://localhost:3000"]# Test WebSocket connection# Open browser console and check for WebSocket errors