This was stupidly simple. I'd never run a bundle install
in my engine folder. You'd think me a newb.
Generators don't work in Rails engine folder
-
04-07-2022 - |
Pergunta
I have an app that's using multiple engines, following the RailsGuides guidelines. The engine works fine in my app, but the docs indicate that generators should work just fine from within the engine, and I can't get mine to work. When I try to run a generator, it says command not found: rails
.
Here are the contents of bin/rails
inside my engine's directory:
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/my_engine/engine', __FILE__)
require 'rails/all'
require 'rails/engine/commands'
Am I missing something?
Solução
Outras dicas
I had to run bundle install
and then bundle exec
after having the same problem
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow