Reputation: 2495
I have a engine called Questions Engine that has rapidfire as a dependency. Rapidfire is also an engine.
In the question_engine.gemspec I have the gem as both as development and as general dependency
s.add_dependency "rapidfire", "~> 2.0.0"
s.add_development_dependency "rapidfire", "~> 2.0.0"
in my root app gemfile I am loading the question engine inside, my root app has rapidfire on its gemlist
group :development, :test do
gem 'question_engine', path: "vendor/engines/QuestionEngine"
end
rapidfire comes with the instructions below
$ bundle install
$ bundle exec rake rapidfire:install:migrations
$ bundle exec rake db:migrate
And if you want to customize rapidfire views, you can do
$ bundle exec rails generate rapidfire:views
Usage
Add this line to your routes will and you will be good to go!
mount Rapidfire::Engine => "/rapidfire"
in my root app config/routes file I have these
Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
root 'home#index'
devise_for :users
mount FormulaEngine::Engine => "/formula_engine"
mount QuestionEngine::Engine, at: 'question_engine'
mount Rapidfire::Engine, at: "/rapidfire"
end
when I do rake routes I am getting this error
NameError: uninitialized constant Rapidfire
It worked two days ago. I have checked my commits and I have only worked on server stuff ever since.
The rapidfire generator runs fine inside root app. I already had the tables migrated. Yes the migration files are not getting copied over to the root app but I don't see how the root app doesn't see rapidfire existing?
I am using rails 4.2
. The gem supports rails 4 versions according to their docs.
did bundle install, getting this message
question_engine at $HOME/vendor/engines/QuestionEngine did not have a valid gemspec. This prevents bundler from installing bins or native extensions, but that may not affect its functionality. The validation message from Rubygems was: "FIXME" or "TODO" is not a description
here is my gemspec
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "question_engine/version"
# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "question_engine"
s.version = QuestionEngine::VERSION
s.authors = ["somebody"]
s.email = ["[email protected]"]
s.homepage = "TODO"
s.summary = "TODO: Summary of QuestionEngine."
s.description = "TODO: Description of QuestionEngine."
s.license = "MIT"
s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
s.test_files = Dir["test/**/*"]
s.add_dependency "rails", "~> 4.2.0"
s.add_dependency "rapidfire", "~> 2.0.0"
#s.add_development_dependency "rapidfire", "~> 2.0.0"
s.add_development_dependency "sqlite3"
end
Upvotes: 1
Views: 466