If you see:
Could not find generator 'rails_a11y:install'. (Rails::Command::CorrectableNameError)
-
Clear Rails cache (if using Spring):
bundle exec spring stop -
Restart your terminal - Sometimes Rails caches generator lists
-
Verify the gem is loaded:
bundle show rails_accessibility_testing
Should show:
/Users/imregan/workprojects/rails-accessibility-testing -
Check generator is discoverable:
bundle exec rails generate --help | grep a11y
Should show:
rails_a11y:install -
Try running the generator with bundle exec:
bundle exec rails generate rails_a11y:install -
If using a local path gem (like
path: '../rails-accessibility-testing'):- Make sure the path is correct in your Gemfile
- Run
bundle installagain - Restart your terminal
-
Clear tmp cache:
rm -rf tmp/cache
-
Verify the generator file exists:
ls -la lib/generators/rails_a11y/install/install_generator.rb
- Spring caching - Rails Spring preloader caches generators
- Terminal session - Old terminal sessions might have stale cache
- Gem path issues - Local path gems need bundle install after changes
- File permissions - Generator files need to be readable
# Stop Spring (if running)
bundle exec spring stop
# Clear cache
rm -rf tmp/cache
# Reinstall bundle (if using local path)
bundle install
# Try generator again
bundle exec rails generate rails_a11y:install