英文:
Rails 7: Could not find generator 'stimulus'
问题
我最近将我们的应用程序升级到Rails 7,并希望使用Stimulus。我了解到在Rails 7中,默认情况下会带有Stimulus。
我尝试执行rails generate stimulus Downloader
,但结果是找不到生成器 'stimulus'。
我需要执行其他任何步骤来使用Stimulus吗?
在这方面有任何帮助将会很好,谢谢。
英文:
I have recently upgraded our application to Rails 7 and want to use Stimulus. I understand that with Rails 7 its comes by default.
I am trying to execute rails generate stimulus Downloader
but this results in Could not find generator 'stimulus'.
Are there any additional steps i need to perform to use Stimulus?
Any help here would be great, thanks.
答案1
得分: 1
它以 stimulus-rails
gem 的形式随 rails 7 一起提供:
https://github.com/hotwired/stimulus-rails#installing-with-installer
bundle add stimulus-rails
bin/rails stimulus:install
其他所有内容也以 gem 的形式提供,包括 importmap-rails
、jsbundling-rails
、cssbundling-rails
、turbo-rails
、tailwindcss-rails
- 当您使用 rails new
创建新应用时,rails 会为您运行相应的安装任务。对于现有的应用程序,您必须按照每个 gem 的安装说明进行安装。
英文:
It comes with rails 7 in a form of a gem stimulus-rails
:
https://github.com/hotwired/stimulus-rails#installing-with-installer
bundle add stimulus-rails
bin/rails stimulus:install
Everything else also comes in a gem importmap-rails
, jsbundling-rails
, cssbundling-rails
, turbo-rails
, tailwindcss-rails
- and has an install task which rails runs for you when making a new app with rails new
. For existing apps you have to follow install instructions for each gem.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论