1
0

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 3 years have passed since last update.

[Error] Could not find generator 'devise:install' . rails g:devise install

Posted at

発生したError

$ rails g:devise install

Running via Spring preloader in process 26089
Could not find generator 'devise:install'. 
Run `rails generate --help` for more options

解決した方法

開発中に何度も実行するようなrailsなどのコマンドを素早く実行することができるようになるrailsのプリローダであるspringを停止してからInstallするようにした。

1.springの起動を確認

$ bin/spring status

 8465 spring server | techpitgram | started 11 hours ago
 8467 ruby -I /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.1/lib -e require 'spring/application/boot'

2.springを停止

$ bin/spring stop

Spring stopped.

3.deviseをGemで再インストール

Gemfile

gem 'devise'

terminal

$ bundle install

Using devise 4.8.1

4. devise install

$ rails g devise:install 

     create  config/initializers/devise.rb
      create  config/locales/devise.en.yml
===============================================================================

Depending on your application's configuration some manual setup may be required:

  1. Ensure you have defined default url options in your environments files. Here
     is an example of default_url_options appropriate for a development environment
     in config/environments/development.rb:

       config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }

     In production, :host should be set to the actual host of your application.

     * Required for all applications. *

  2. Ensure you have defined root_url to *something* in your config/routes.rb.
     For example:

       root to: "home#index"
     
     * Not required for API-only Applications *

  3. Ensure you have flash messages in app/views/layouts/application.html.erb.
     For example:

       <p class="notice"><%= notice %></p>
       <p class="alert"><%= alert %></p>

     * Not required for API-only Applications *

  4. You can copy Devise views (for customization) to your app by running:

       rails g devise:views
       
     * Not required *

===============================================================================

参考にしたもの

まとめ

おそらく立ち上げた状態で操作したので上記のようなErrorが発生したのかな??
railsコマンドがうまく動作しなかった時はspringを止めることも今後試したい。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?