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?

有帮助吗?

解决方案

This was stupidly simple. I'd never run a bundle install in my engine folder. You'd think me a newb.

其他提示

I had to run bundle install and then bundle execafter having the same problem

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top