我正在尝试制作一个需要设备的项目。正在尝试安装它,但显示此错误找不到生成器"design:install">我也试着取下弹簧,但它不起作用。此外,我还尝试卸载并再次安装设备文件,但仍然没有发生任何事情。
我的宝石文件是
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.9'
gem 'device'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.4', '>= 6.1.4.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', '~> 1.4'
# 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
gem 'rails_warden'
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'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
在运行命令bundle install
之后,我得到了以下结果。
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using i18n 1.8.11
Using minitest 5.15.0
Using tzinfo 2.0.4
Using zeitwerk 2.5.1
Using activesupport 6.1.4.3
Using builder 3.2.4
Using erubi 1.10.0
Using racc 1.6.0
Using nokogiri 1.12.5 (x86_64-linux)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.13.0
Using rails-html-sanitizer 1.4.2
Using actionview 6.1.4.3
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.1.4.3
Using nio4r 2.5.8
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.5
Using actioncable 6.1.4.3
Using globalid 1.0.0
Using activejob 6.1.4.3
Using activemodel 6.1.4.3
Using activerecord 6.1.4.3
Using marcel 1.0.2
Using mini_mime 1.1.2
Using activestorage 6.1.4.3
Using mail 2.7.1
Using actionmailbox 6.1.4.3
Using actionmailer 6.1.4.3
Using actiontext 6.1.4.3
Using public_suffix 4.0.6
Using addressable 2.8.0
Using bindex 0.8.1
Using msgpack 1.4.2
Using bootsnap 1.9.3
Using bundler 2.2.32
Using byebug 11.1.3
Using matrix 0.4.2
Using regexp_parser 2.2.0
Using xpath 3.2.0
Using capybara 3.36.0
Using childprocess 4.1.0
Using device 0.0.0
Using ffi 1.15.4
Using jbuilder 2.11.3
Using rb-fsevent 0.11.0
Using rb-inotify 0.10.1
Using listen 3.7.0
Using method_source 1.0.0
Using puma 5.5.2
Using rack-mini-profiler 2.3.3
Using rack-proxy 0.7.0
Using thor 1.1.0
Using railties 6.1.4.3
Using sprockets 4.0.2
Using sprockets-rails 3.4.2
Using rails 6.1.4.3
Using warden 1.2.9
Using rails_warden 0.6.0
Using rexml 3.2.5
Using rubyzip 2.3.2
Using sassc 2.4.0
Using tilt 2.0.10
Using sassc-rails 2.1.2
Using sass-rails 6.0.0
Using selenium-webdriver 4.1.0
Using semantic_range 3.0.0
Using spring 3.1.1
Using sqlite3 1.4.2
Using turbolinks-source 5.2.0
Using turbolinks 5.2.1
Using web-console 4.2.0
Using webdrivers 5.0.0
Using webpacker 5.4.3
Bundle complete! 19 Gemfile dependencies, 78 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
Aditya。你有拼写错误。这块宝石被设计成";s";而不是";c";。
gem 'devise'
执行:
$ bundle
然后你就可以执行了。
$ rails generate devise:install
一切都会好起来的。