0
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 1 year has passed since last update.

rails g devise:installを実行できない

Posted at

rails g devise:install
を実行できません。

質問:
gemfile.lockにdeviceがダウンロードできているかどうか確認するしたいので表示される名前を教えていただきたいです。もしくはダウンロードするにはどうしたらいいのでしょうか。
(device!をgemfile.lockに2行目に構文エラーが出ます)

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

と表示されます。

内容を和訳すると
プレローダーがスプリング経由で動いている
generatorが見つからない
と表示されている。
1-3を試した結果、結局のところ、gemfile.lockにdeviceがダウンロードされていない可能性が高そうです。

なお1.2.3の手順で解決しようと試みました。
以下の3について、gemfile.lockにインストールされていない

1,springの停止

❯ bundle exec spring stop
Spring stopped.

2,gemfileの書き換え

gemfile内に
gem "devise"
を加えて
bundle install 
を実行

3再度実行(改善が見られない)

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

結局のところ、gemfile.lockにdeviceがダウンロードされていない可能性が高そうです。

gemfile


source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.1.2'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.6', '>= 6.1.6.1'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 4.1.0'
  # Display performance information such as SQL time and flame graphs for each request in your browser.
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
  gem 'rack-mini-profiler', '~> 2.0'
  gem 'listen', '~> 3.3'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem "net-smtp"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.1.6.1)
      actionpack (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.1.6.1)
      actionpack (= 6.1.6.1)
      activejob (= 6.1.6.1)
      activerecord (= 6.1.6.1)
      activestorage (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      mail (>= 2.7.1)
    actionmailer (6.1.6.1)
      actionpack (= 6.1.6.1)
      actionview (= 6.1.6.1)
      activejob (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.1.6.1)
      actionview (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      rack (~> 2.0, >= 2.0.9)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.1.6.1)
      actionpack (= 6.1.6.1)
      activerecord (= 6.1.6.1)
      activestorage (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      nokogiri (>= 1.8.5)
    actionview (6.1.6.1)
      activesupport (= 6.1.6.1)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.1.6.1)
      activesupport (= 6.1.6.1)
      globalid (>= 0.3.6)
    activemodel (6.1.6.1)
      activesupport (= 6.1.6.1)
    activerecord (6.1.6.1)
      activemodel (= 6.1.6.1)
      activesupport (= 6.1.6.1)
    activestorage (6.1.6.1)
      actionpack (= 6.1.6.1)
      activejob (= 6.1.6.1)
      activerecord (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      marcel (~> 1.0)
      mini_mime (>= 1.1.0)
    activesupport (6.1.6.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
      zeitwerk (~> 2.3)
    bindex (0.8.1)
    bootsnap (1.13.0)
      msgpack (~> 1.2)
    builder (3.2.4)
    byebug (11.1.3)
    concurrent-ruby (1.1.10)
    crass (1.0.6)
    digest (3.1.0)
    erubi (1.11.0)
    ffi (1.15.5)
    globalid (1.0.0)
      activesupport (>= 5.0)
    i18n (1.12.0)
      concurrent-ruby (~> 1.0)
    jbuilder (2.11.5)
      actionview (>= 5.0.0)
      activesupport (>= 5.0.0)
    listen (3.7.1)
      rb-fsevent (~> 0.10, >= 0.10.3)
      rb-inotify (~> 0.9, >= 0.9.10)
    loofah (2.18.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (1.0.2)
    method_source (1.0.0)
    mini_mime (1.1.2)
    minitest (5.16.2)
    msgpack (1.5.4)
    net-protocol (0.1.3)
      timeout
    net-smtp (0.3.1)
      digest
      net-protocol
      timeout
    nio4r (2.5.8)
    nokogiri (1.13.8-x86_64-darwin)
      racc (~> 1.4)
    pg (1.4.3)
    puma (5.6.4)
      nio4r (~> 2.0)
    racc (1.6.0)
    rack (2.2.4)
    rack-mini-profiler (2.3.4)
      rack (>= 1.2.0)
    rack-proxy (0.7.2)
      rack
    rack-test (2.0.2)
      rack (>= 1.3)
    rails (6.1.6.1)
      actioncable (= 6.1.6.1)
      actionmailbox (= 6.1.6.1)
      actionmailer (= 6.1.6.1)
      actionpack (= 6.1.6.1)
      actiontext (= 6.1.6.1)
      actionview (= 6.1.6.1)
      activejob (= 6.1.6.1)
      activemodel (= 6.1.6.1)
      activerecord (= 6.1.6.1)
      activestorage (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      bundler (>= 1.15.0)
      railties (= 6.1.6.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.4.3)
      loofah (~> 2.3)
    railties (6.1.6.1)
      actionpack (= 6.1.6.1)
      activesupport (= 6.1.6.1)
      method_source
      rake (>= 12.2)
      thor (~> 1.0)
    rake (13.0.6)
    rb-fsevent (0.11.1)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    sass-rails (6.0.0)
      sassc-rails (~> 2.1, >= 2.1.1)
    sassc (2.4.0)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    semantic_range (3.0.0)
    spring (4.0.0)
    sprockets (4.1.1)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.4.2)
      actionpack (>= 5.2)
      activesupport (>= 5.2)
      sprockets (>= 3.0.0)
    thor (1.2.1)
    tilt (2.0.11)
    timeout (0.3.0)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (2.0.5)
      concurrent-ruby (~> 1.0)
    web-console (4.2.0)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webpacker (5.4.3)
      activesupport (>= 5.2)
      rack-proxy (>= 0.6.1)
      railties (>= 5.2)
      semantic_range (>= 2.3.0)
    websocket-driver (0.7.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    zeitwerk (2.6.0)

PLATFORMS
  x86_64-darwin-19

DEPENDENCIES
  device!
  bootsnap (>= 1.4.4)
  byebug
  jbuilder (~> 2.7)
  listen (~> 3.3)
  net-smtp
  pg (~> 1.1)
  puma (~> 5.0)
  rack-mini-profiler (~> 2.0)
  rails (~> 6.1.6, >= 6.1.6.1)
  sass-rails (>= 6)
  spring
  turbolinks (~> 5)
  tzinfo-data
  web-console (>= 4.1.0)
  webpacker (~> 5.0)

RUBY VERSION
   ruby 3.1.2p20

BUNDLED WITH
   2.3.19

0
0
1

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