6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Could not find generator xxx. Maybe you meant xxx

Last updated at Posted at 2019-05-06

背景

Gemfile に新しい gem を追加後 bundle update して rails generate コマンドを打ってみたけど認識されなかった。

$ rails g serializer book
Running via Spring preloader in process 16248
Could not find generator 'serializer'. Maybe you meant 'helper', 'erb:mailer' or 'mailer'
Run `rails generate --help` for more options.

対応

spring stop と打ちました。

$ spring stop

成功。

$ rails g serializer book
Running via Spring preloader in process 16372
      create  app/serializers/book_serializer.rb

ちなみに Spring も元通り動いています。

$ spring status
Spring is running:

Rails Spring

spring

Spring is a Rails application preloader. It speeds up development by keeping your application running in the background so you don't need to boot it every time you run a test, rake task or migration.

普段全く意識していなかったのですが、バックグラウンドで動いてくれているアプリケーションプリローダーのようです。
Rails 4.1 で標準になったようです。

参考

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?