NameError: uninitialized constant Rapidfire Engine Mounted on Root Application Routing did not have a valid gemspec - ruby-on-rails-4.2

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 = ["somebody#gmail.com"]
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

Related

Hyperledger Fabric Nix Derivation

I'm trying to build a nix derivation for the Hyperledger Fabric project.
source root is source
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "hyperledger-fabric";
src = builtins.fetchGit {
url = "https://github.com/hyperledger/fabric";
rev = "d0eaa0646fc83bf17066a82f54b3c99370914a02";
};
depsBuildBuild = [curl which git];
nativeBuildInputs = [go docker];
}
when running nix-build fabric.nix I receive:
nix-build fabric.nix
these derivations will be built:
/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv
building '/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv'...
unpacking sources
unpacking source archive /nix/store/q4mq48i1f7sp7d8f3n8w6q8kp053h9ny-source
source root is source
patching sources
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/n9hba031gjky8hpjgx9fnlaxhidyzxbz-bash-4.4-p23/bin/bash
gotools.mk:22: *** target pattern contains no '%'. Stop.
builder for '/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv' failed with exit code 2
error: build of '/nix/store/8z0wlnf8897ng5wkfjja66m31fafsqyp-hyperledger-fabric.drv' failed
The error points to https://github.com/hyperledger/fabric/blob/release-1.4/gotools.mk#L22
Do I need to set environment variables or what is causing the problem ?
Solved by use of buildGoPackage, see https://github.com/NixOS/nixpkgs/pull/52551

Yocto do_package_qa hangs for bin_package nodejs recipe

Using Yocto morty, I'm trying to add a prebuilt version of nodejs in my distribution. When I bitbake core-image-sato, do_package_qa hangs for hours. I'd be grateful for your help in getting me past this issue.
I've added this to the bottom of local.conf:
CORE_IMAGE_EXTRA_INSTALL += "mynode"
This is my recipe for mynode:
SUMMARY = "puts the node.js binary distribution into my image"
SECTION = "base"
LICENSE = "MIT & BSD & Artistic-2.0"
LIC_FILES_CHKSUM = "file://usr/node-v7.10.0-linux-x64/LICENSE;md5=d29463feca32ea5977af7b6c7d62c14a"
SRC_URI = "https://nodejs.org/dist/v7.10.0/node-v7.10.0-linux-x64.tar.xz;subdir=usr"
SRC_URI[md5sum] = "b9122f212e0716d199d7e954ff81e1ec"
SRC_URI[sha256sum] = "6166b9f3fb1a9e861335d864688fee5366f040db808080856a1a2b71b6019786"
S = "${WORKDIR}"
inherit bin_package
This is the content of log.do_install for my nodejs package. Maybe the message from tar describes my problem somehow?
DEBUG: Executing shell function do_install
tar: ./pseudo/pseudo.socket: socket ignored
DEBUG: Shell function do_install finished
There doesn't appear to be anything useful in log.do_package_qa for my nodejs package, but maybe somebody will see something that I don't see:
DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing python function do_package_qa
NOTE: DO PACKAGE QA
DEBUG: Executing python function read_subpackage_metadata
DEBUG: Python function read_subpackage_metadata finished
NOTE: Checking Package: mynode-dev
NOTE: Checking Package: mynode
I see a few bitbake-worker processes running, one with argument decafbad, two with argument decafbadbeef. I also see a pseudo process running.
If you're going to use
subdir=usr
At the end of SRC_URI then you also need to change the source directory it uses (S) accordingly:
S = "${WORKDIR}/usr"
In addition, I think for all pre-built binary packages (inherit bin_package), you want to do it that way. I tried without either and it hung forever. Also, you may want to use a subdir name that nothing else uses, like say external_binary. That way each binary recipe can use the same subdir.

Phoenix New Install Cannot Compile :fs Windows 10

Fresh install of Elixir, Erlang, Phoenix, etc. on Windows 10. I have installed Hex and rebar multiple times. No matter how many 'fixes' on read on various gits or other how-to pages, I cannot get mix phoenix.server to run. Same error everytime.
mix phoenix.server
The system cannot find the path specified.
==> fs (compile)
** (Mix) Could not compile dependency :fs, "escript.exe "c:/Users/shawn.karber/.mix/rebar" compile skip_deps=true deps_dir="e:/sandbox/phoenix/test/test/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile fs", update it with "mix deps.update fs" or clean it with "mix deps.clean fs"
I've refetched, updated, recompile, cleaned, reinstalled over and over and I cannot get the server to start. Anyone have any experience with this or have any idea how to fix it?
node 6.9.1
erlang 19.0
elixir 1.4.1
rebar and rebar 3 both installed
all paths are in my PATH
defmodule Test.Mixfile do
use Mix.Project
def project do
[app: :test,
version: "0.0.1",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
aliases: aliases(),
deps: deps()]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[mod: {Test, []},
applications: [:phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex]]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "web", "test/support"]
defp elixirc_paths(_), do: ["lib", "web"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[{:phoenix, "~> 1.2.1"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.6"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"}]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
["ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"test": ["ecto.create --quiet", "ecto.migrate", "test"]]
end
end

Grunt: How to change config strings for different environments

I have a python file as part of my grunt workflow. I have defined two build tasks:
build:dev
build:release
When I compile 'build:dev', I want to add this line to my python file:
...
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + dbpath
...
When I compile 'build:release', I want to add this line to my python file:
...
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['POSTGRESQL_COLORFUL_URL']
...
edit: fixed typo in code and title
You can use grunt-sed.
It's a really useful 'find and replace' system that builds into Grunt.
From the docs:
npm install grunt-sed
Add this line to your project's Gruntfile.js:
grunt.loadNpmTasks('grunt-sed');
Then in your build:dev and build:release tasks have the following:
sed: {
database_uri: {
path: 'path_to_your_python.py',
pattern: '%PATTERN_IN_YOUR_PYTHON_FILE%',
replacement: '\'sqlite:///\' + dbpath',
}
}
In your python file you want replacing you must also have %PATTERN_IN_YOUR_PYTHON_FILE% to be replaced.
I've used a plugin called grunt-string-replace that worked very well for what I needed to do. Also, I added some custom code in my Gruntfile.js to read different environment configurations and customize the build output based on that.
I detailed the full deployment script in this post: http://dev-blog.cloud-spinners.com/2014/02/complete-grunt-deployment-workflow-for.html
I hope you find that useful.

Why Chef do not find my files?

I'm developing a Ganglia recipe in Chef.
Is very simple, I build four different configurations files, I already tried to use as template, but to keep it simple, I build these configuration files.
This is my recipe:
return if tagged?('norun::ganglia')
case node[:platform]
when "ubuntu", "debian"
pkg = "ganglia-monitor"
when "redhat", "centos", "fedora"
pkg = "ganglia-gmond"
end
package "#{pkg}" do
action :install
end
cookbook_file "/etc/ganglia/gmond.conf" do
owner "root"
group "root"
mode "0644"
source "gmond/" + node['base']['dc'] + "/node/gmond.conf"
end
# Adding ganglia-gmond as service
service "gmond" do
supports :status => true,
:restart => true
action [ :enable, :start ]
end
And this is how my recipe is structured:
cookbooks/ganglia/
cookbooks/ganglia/files/default/gmond/* // I have others sub-folders here too
cookbooks/ganglia/files/default/gmond/diveo/node/gmond.conf
cookbooks/ganglia/recipes/default.rb
But when I tried to run my recipe, it gives the follow error:
[2013-05-14T14:23:38+00:00] FATAL: Chef::Exceptions::FileNotFound: cookbook_file[/etc/ganglia/gmond.conf] (ganglia::default line 25) had an error: Chef::Exceptions::FileNotFound: Cookbook 'ganglia' (0.1.0) does not contain a file at any of these locations:
files/centos-5.7/gmond/diveo/node/gmond.conf
files/centos/gmond/diveo/node/gmond.conf
files/default/gmond/diveo/node/gmond.conf
This cookbook _does_ contain: ['diveo/monitor/gmond.conf','diveo/node/gmond.conf','awsvir/monitor/gmond.conf','awsvir/node/gmond.conf','awssp/monitor/gmond.conf','awssp/node/gmond.conf','alog/monitor/gmond.conf','alog/node/gmond.conf']
Basically it says that I not have the file, but I do, in the right path, right ?
If node['base']['dc'] is a platform name, then cookbook_file statement should look like
cookbook_file "/etc/ganglia/gmond.conf" do
owner "root"
group "root"
mode "0644"
source "gmond.conf"
end
and structure of your conf files should be like that
cookbooks/ganglia/
cookbooks/ganglia/files/default/gmond.conf
cookbooks/ganglia/files/centos-5.7/gmond.conf
...
And a little advice - use template instead of cookbook_file. One day you'll want to add some parameters to your gmane.conf anyway.
Also, here is a cookbook_file doc page from opscode.com -

Resources