rake neo4j:create error rake aborted - rake

>sudo rake neo4j:create --trace [ 6:18PM]
rake aborted!
Don't know how to build task 'neo4j:create'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/task_manager.rb:49:in []'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:115:ininvoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:ineach'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:94:in top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:88:in top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:66:inrun'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:133:in standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/lib/rake/application.rb:63:inrun'
/usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake:33
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
What may be the probable reason for this error. I am following the maxdemarzi introduction to neo4j and d3.js.
I will be thankful if some one can suggest the solution
https://github.com/maxdemarzi/d3_js_intro

I've updated the project so it works now. Please run:
git pull # Get the latest code
bundle install # Update the project gems
rake neo4j:reset_yes_i_am_sure # Reset the Neo4j Server
rake neo4j:create
Ping me if you still have trouble.
Regards,
Max

Related

How to setup tRPC project with pnpm

I am trying to learn from this repo.
Step 3 of the setup instructions says to run yarn dx.
The package.json for this repo defines that script as:
"dx": "run-p dx:* --print-label",
When I try to do this, I get an error message that says:
yarn dx yarn run v1.22.19 $ run-p dx:* --print-label [dx:next
] $ run-s migrate-sqlite generate-sqlite db-seed && next dev
[dx:prisma-studio] $ pnpm prisma-studio-sqlite [dx:prisma-studio]
/bin/sh: pnpm: command not found [dx:prisma-studio] error Command
failed with exit code 127. [dx:prisma-studio] info Visit
https://yarnpkg.com/en/docs/cli/run for documentation about this
command. ERROR: "dx:prisma-studio" exited with 127. error Command
failed with exit code 1.
I'm not sure what pnpm means, or why prisma is trying to link to sqlite when the db it specifies is psql.
Can anyone point me in the direction of what's required to get this repo to start?
If you use yarn, change any occurrence in the package.json from pnpm to yarn and I think it should work :)

Command failed with exit code 2 in ionic

I HAVE THIS ERROR
On build app in ionic
sudo ionic build android
Error: ANDROID_HOME is not set and "android" command not in your PATH.
You must fulfill at least one of these conditions.
at /home/sbh/testt/mobilebra/platforms/android/cordova/lib/check_reqs.js:206:19
at _fulfilled (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:760:13)
at /home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:821:14
at flush (/home/sbh/testt/mobilebra/platforms/android/cordova/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:607:11)
at run (bootstrap_node.js:422:7)
Error: /home/sbh/testt/mobilebra/platforms/android/cordova/build:
Command failed with exit code 2
Do the following:
(nano is my preference, use whatever your heart desires)
sudo nano ~/.bashrc
add the following lines, modifying the paths if your SDKs in a different spot:
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

'Don't know how to build task' error in Capistrano 3

I'm trying to learn to use Capistrano 3 by following the DOCS and I've written a simple task to test my understanding.
The task is created in the default task dir in lib/capistrano/tasks:
desc "Check status of web server"
task :nginx_status do
on roles(:web) do |host|
execute 'service nginx status'
end
end
My config/deploy/staging.rb file contains the following:
set :stage, :staging
role :web, "192.168.0.11"
role :app, "192.168.0.11"
role :db, "192.168.0.11", primary:true
server '192.168.0.11', user: 'vagrant', roles: %w{web app}
Capfile
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
My deploy.rb contains an app name and a repo url to github.
When I run cap staging nginx_status I get the following error:
** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
Don't know how to build task 'nginx_status'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/task_manager.rb:62:in `[]'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:149:in `invoke_task'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:106:in `each'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:106:in `block in top_level'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:115:in `run_with_threads'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:100:in `top_level'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:78:in `block in run'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rake-10.3.1/lib/rake/application.rb:75:in `run'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/capistrano-3.2.1/lib/capistrano/application.rb:15:in `run'
/Users/H/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/capistrano-3.2.1/bin/cap:3:in `<top (required)>'
/Users/H/.rbenv/versions/2.1.1/bin/cap:23:in `load'
/Users/H/.rbenv/versions/2.1.1/bin/cap:23:in `<main>'
I also noticed that if I ran cap -vT the task nginx_status is not in the list(?)
On a side note, are SSH keys a must to connect to remote servers?
UPDATE 1
I found that if I place my task in config/deploy.rb it works. So the question I now have is how do you run tasks from the task dir?
UPDATE 2
So as per the Capfile the tasks dir is looked at by the following:
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
So I changed the task extension to .rake and it worked. However the documentation says it should be .cap
"We'll dive into those more later, but add those lines to a file in ./lib/capistrano/tasks, call it something like access_check.cap"
Take a look at this commit.
They've switched from .cap to .rake 3 months ago.
The whole idea is to make capistrano3 fully rake-compatible. Just use .rake extension for you tasks.

Undefined method when running db:schema:dump using pg_power gem

I have a migration I am trying to run to generate postgresql schemas using pg_power.
class CreateSchemas < ActiveRecord::Migration
def change
create_schema 'deprecated'
create_schema 'leaf'
create_schema 'mmp'
create_schema 'mmp_static'
create_schema 'nass'
create_schema 'static'
end
end
When I run the migration, I get the following error
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
rake aborted!
undefined method `[]' for nil:NilClass
/Users/Pro777/.bundler/ruby/2.0.0/pg_power-36a643247425/lib/pg_power/schema_dumper/extension_methods.rb:17:in `block in dump_extensions'
/Users/Pro777/.bundler/ruby/2.0.0/pg_power-36a643247425/lib/pg_power/schema_dumper/extension_methods.rb:15:in `map'
/Users/Pro777/.bundler/ruby/2.0.0/pg_power-36a643247425/lib/pg_power/schema_dumper/extension_methods.rb:15:in `dump_extensions'
/Users/Pro777/.bundler/ruby/2.0.0/pg_power-36a643247425/lib/pg_power/schema_dumper/extension_methods.rb:6:in `header_with_extensions'
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/schema_dumper.rb:26:in `dump'
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/schema_dumper.rb:21:in `dump'
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:244:in `block (4 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:243:in `open'
/Library/Ruby/Gems/2.0.0/gems/activerecord-4.0.0/lib/active_record/railties/databases.rake:243:in `block (3 levels) in <top (required)>'
I should say I'm using ruby 2.0, rails 4.0, and the rails4 branch of pg_power.
The library was tested with Ruby <= 1.9.3 (you are using 2.0) and ActiveRecord 3.
It was tested with Rails 3.1.x and 3.2.x, Ruby 1.8.7 REE and 1.9.3.
Moreover, there seems to be some incompatibilities with Rails 4.
The library doesn't use public ActiveRecord API but uses monkey patching (alias_method_chain). I won't be surprise if the exception is because the library does not currently work with Rails 4.
In order to fix the issue you should look what changed in the ActiveRecord internals from Rails 3 to Rails 4 and update the corresponding overrides in the Gem. It may be a small or huge effort, depending on the amount of changes.
I encourage you find an alternative and report the issue in the official issue tracker.
When you was trying to run pg_power against rails4, it really didn't work well.
Now, pg_power supports rails4, you must use 2.X.X version.

Neo4j rake aborted! No such file or directory - wget http://dist.neo4j.org/neo4j-community-1.7-unix.tar.gz

Trying to install and run a simple Neo4j app from Max Demarzi's "d3_js_intro" app on GitHub. Issuing the command rake neo4j:install, I get the message shown below. Questions:
Q: What is the root cause of wget failing to get the file; a file that appears to exist in exactly the place expected? (Note: the URL following the error message "No such file or directory" is valid; that file exists there... so message is incorrect. Why?) A: the root cause was that wget is not installed on a Mac OSX machine. If you are running a Mac OSX machine, you too will need to install wget.
I've tried:
I've manually downloaded the file (http://dist.neo4j.org/neo4j-community-1.7-unix.tar.gz) that the wget was failing to get.
extracting the file to the app root directory.
Questions related to manually recovering from this problem:
Q: Does the manually-extracted directory need to be named anything special? (i.e.: "Neo4j", "neo4j", etc.). A: It would have to be called "neo4j", but the fix (below) eliminates the need to do this.
Q: What configuration files would I need to modify (and how) in order to get the app to see the neo4j server? A: the fix below eliminates the need to deal with this.
The gem files reads:
source 'http://rubygems.org'
gem 'sinatra'
gem 'neography'
gem 'haml'
gem 'json'
group :test do
gem 'rspec'
gem 'rack-test'
gem 'net-http-spy'
end
The Rakefile reads:
require 'neography/tasks'
require './d3.rb'
namespace :neo4j do
task :create do
create_graph
end
end
Thanks for anything you can provide
- HisHighnessDog
rake neo4j:install --trace
** Invoke neo4j:install (first_time)
** Execute neo4j:install
Installing Neo4j-community-1.7
rake aborted!
No such file or directory - wget http://dist.neo4j.org/neo4j-community-1.7-unix.tar.gz
/Users/tomjones/.rvm/gems/ruby-1.9.3-p194/gems/neography-0.0.26/lib/neography/tasks.rb:44:in ``'
/Users/tomjones/.rvm/gems/ruby-1.9.3-p194/gems/neography-0.0.26/lib/neography/tasks.rb:44:in `block (2 levels) in <top (required)>'
...
...
/Users/tomjones/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/tomjones/.rvm/gems/ruby-1.9.3-p194/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/tomjones/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `load'
/Users/tomjones/.rvm/gems/ruby-1.9.3-p194/bin/rake:23:in `<main>'
Tasks: TOP => neo4j:install
Should I be concerned that the Rakefile does not contain a task entry for 'install', while the command I'm running is rake neo4j:install?
Solution: the root cause for the error message is that (OSX machine default): wget is not installed.
Recovery: Install and configure wget:
curl -O http://ftp.gnu.org/gnu/wget/wget-1.14.tar.gz
tar -xzvf wget-1.13.tar.gz
cd wget-1.14
./configure --with-ssl=openssl
make
sudo make install
which wget (to confirm wget is now installed)
Use the current wget download from gnu org's website.
You have to download, unzip and start a Neo4j server. The version is not relevant in this case. Go to http://neo4j.org/download for instruction and download links.