以下のサイトを参考に解決した。
問題
rails g model~
もできなければ、サーバーも起動できない。railsコマンドを実行すると、こんなエラーメッセージがでる。
FATAL: Listen error: unable to monitor directories for changes. Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info on how to fix this.
Increasing the amount of inotify watchers · guard/listen Wiki · GitHub
上のサイトへ行けと促される。
解決
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
これをするだけでサーバーが起動できた。