This guide covers common issues you might encounter when setting up or running the Synesthesia development environment, along with their solutions.
- Development Environment Issues
- Database Issues
- Redis Issues
- Frontend Issues
- Authentication Issues
- Image Upload Issues
Symptoms:
- The script starts but some services don't appear to be running
- Terminal output stops after starting one or two services
Solutions:
-
Kill any existing processes that might be conflicting:
pkill -f "rails|puma|redis-server|sidekiq"
-
Ensure ports are available:
sudo lsof -i :3000 # Rails sudo lsof -i :6379 # Redis
-
Clean stale PID files:
rm -f tmp/pids/*.pid
-
Try the simplified script:
bin/dev-simple
Symptoms:
- Error messages about process management
- "Process exited with status 1" errors
Solutions:
-
Make sure foreman is installed:
gem install foreman
-
Try running services individually:
# Terminal 1 bin/rails s # Terminal 2 redis-server tmp/redis.conf # Terminal 3 bundle exec sidekiq
Symptoms:
- "PG::ConnectionBad" errors
- "Role 'postgres' does not exist" errors
Solutions:
-
Check PostgreSQL service:
sudo service postgresql status # or sudo systemctl status postgresql
-
Start PostgreSQL if needed:
sudo service postgresql start
-
Verify database.yml configuration:
cat config/database.yml
-
Create role if missing:
sudo -u postgres psql -c "CREATE ROLE gburgess WITH LOGIN CREATEDB PASSWORD 'password';"
Symptoms:
- "Pending Migration Error" messages
- Tables don't exist errors
Solutions:
-
Run migrations:
bin/rails db:migrate
-
Reset database (warning: destroys data):
bin/rails db:drop db:create db:migrate db:seed
Symptoms:
- "Error connecting to Redis" messages
- ActionCable connection failures
Solutions:
-
Check Redis configuration:
cat tmp/redis.conf
-
If using Unix socket mode and having issues, switch to TCP: Edit
bin/dev-server
or usebin/dev-simple
which uses TCP mode. -
Verify Redis is running:
redis-cli ping
Should respond with "PONG"
-
Restart Redis:
redis-cli shutdown redis-server tmp/redis.conf
Symptoms:
- Errors during asset compilation
- Missing JavaScript in browser
Solutions:
-
Check yarn/npm installations:
yarn --version
-
Clear yarn cache:
yarn cache clean
-
Reinstall dependencies:
rm -rf node_modules yarn install
-
Check for TypeScript errors:
yarn type-check
Symptoms:
- CSS not updating
- JavaScript changes not appearing
Solutions:
-
Manually start asset compilation:
yarn dev
-
Clear asset cache:
bin/rails tmp:clear rm -rf app/assets/builds/*
Symptoms:
- "Unauthorized" errors in API responses
- Unable to log in
Solutions:
-
Check browser localStorage for token:
// In browser console localStorage.getItem('token')
-
Verify JWT configuration:
cat config/initializers/devise.rb
-
Clear JWT denylist:
bin/rails c JwtDenylist.delete_all
Symptoms:
- Image uploads fail
- Cloudinary errors in logs
Solutions:
-
Check Cloudinary configuration:
cat config/initializers/cloudinary.rb
-
Verify environment variables:
cat .env | grep CLOUDINARY
-
Test Cloudinary connection:
bin/rails c Cloudinary::Uploader.upload("app/assets/images/default-avatar.svg")
Symptoms:
- Broken image links
- "ActiveStorage::FileNotFoundError" errors
Solutions:
-
Check storage service configuration:
cat config/storage.yml
-
Purge problematic attachments:
bin/rails c User.find(1).avatar.purge
-
Reset Active Storage tables:
bin/rails active_storage:purge:unattached
If you're still experiencing problems after trying these solutions:
-
Check the application logs:
tail -f log/development.log
-
Run the application in debug mode:
bin/rails s --debug
-
Try the test environment to verify the core functionality:
bin/test-environment
-
File an issue on the GitHub repository with detailed error information and steps to reproduce.