[英]rake aborted! Don't know how to build task 'snorby:setup'
我正在嘗試在我的ubuntu 16.04
桌面上安裝snorby
,但是當我運行RAILS_ENV=production bundle exec rake snorby:setup.
我得到錯誤rake aborted! Don't know how to build task 'snorby:setup'
rake aborted! Don't know how to build task 'snorby:setup'
。 有人可以幫我解決問題嗎? 非常感謝hhhh。 這是我的“游戲文件”
更新:上傳我的 RAILS_ENV=production bundle exec rake -vT 和文件 /lib/tasks/snorby.rake
source 'https://rubygems.org'
RAILS_VERSION = '3.2.22'
RSPEC_VERSION = '~> 2.0.0'
DATAMAPPER = 'https://github.com/datamapper'
DM_VERSION = '~> 1.2.0'
gem 'rubocop', require: false ## This is not the original gamefile, I added this gamefile to another package, which is rubocop. because before I get the message "Rake Aborted: needed Rubocop / task_file. You can notice" gem 'rubocop', require: false"
gem 'rake', '0.9.2'
gem 'request_store', '~> 1.0.5'
gem 'rails', RAILS_VERSION
gem 'jquery-rails'
gem 'bundler', '>= 1.0.0'
gem 'env'
gem 'json', '~> 1.8.3'
# Jruby
gem 'jruby-openssl', :platforms => :jruby
gem 'warbler', :platforms => :jruby
gem 'jruby-rack-worker', :platforms => :jruby
# gem 'glassfish', :platforms => :jruby
# DateTime Patches
gem 'home_run', :require => 'date', :platforms => :mri
gem 'activesupport', RAILS_VERSION, :require => 'active_support'
gem 'actionpack', RAILS_VERSION, :require => 'action_pack'
gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer'
gem 'railties', RAILS_VERSION, :require => 'rails'
gem 'dm-core', DM_VERSION
gem 'dm-rails', DM_VERSION
gem 'dm-do-adapter', DM_VERSION
gem 'dm-active_model', DM_VERSION
gem 'dm-mysql-adapter', DM_VERSION
gem 'dm-postgres-adapter', DM_VERSION
gem 'dm-pager', '~> 1.1.0'
gem "dm-ar-finders", DM_VERSION
gem 'dm-migrations', DM_VERSION
gem 'dm-types', DM_VERSION
gem 'dm-validations', DM_VERSION
gem 'dm-constraints', DM_VERSION
gem 'dm-transactions', DM_VERSION
gem 'dm-aggregates', DM_VERSION
gem 'dm-timestamps', DM_VERSION
gem 'dm-observer', DM_VERSION
gem 'dm-serializer', DM_VERSION
gem 'dm-is-read_only', '~> 0.3', :git => 'https://github.com/postmodern/dm-is-read_only.git'
gem 'dm-chunked_query', '~> 0.3'
# Deploy with Capistrano
gem 'capistrano', '2.14.1'
# Rails Plugins
gem 'jammit', '~> 0.5.4'
gem 'cancan', '~> 1.6'
gem 'devise', '~> 1.4'
gem 'dm-devise', '~> 1.5'
gem 'rubycas-client'
gem 'devise_cas_authenticatable'
gem "mail", '~> 2.3'
gem "RedCloth", "~> 4.2.9", :require => 'redcloth'
gem 'chronic', '~> 0.3.0'
gem 'pdfkit', '~> 0.4.6'
gem 'ezprint', :git => 'https://github.com/mephux/ezprint.git', :branch => 'rails3', :require => 'ezprint'
gem 'daemons', '~> 1.1.0'
gem 'delayed_job', '~> 2.1.4'
gem 'delayed_job_data_mapper', '~> 1.0.0.rc', :git => 'https://github.com/Snorby/delayed_job_data_mapper.git'
# Working On This
# gem 'delayed_job', '~> 3.0'
# gem 'delayed_job_data_mapper', '~> 1.0.0.rc', :git => 'https://github.com/collectiveidea/delayed_job_data_mapper.git'
# Old - Remove Avatar Support
# gem 'rmagick', '~> 2.13.1'
# gem 'dm-paperclip', '~> 2.4.1', :git => 'https://github.com/Snorby/dm-paperclip.git'
gem 'net-dns', '~> 0.8.0'
gem 'whois', '~> 2.3.0'
gem 'simple_form', '~> 1.2.2'
gem 'geoip', '~> 1.1.1'
gem 'netaddr', '~> 1.5.0'
gem 'dm-zone-types', '~> 0.3'
gem 'timezone_local', '~> 0.1.5'
group(:development) do
gem "letter_opener"
gem 'thin'
gem 'byebug'
end
group(:test) do
gem 'capybara'
gem 'test-unit'
gem 'rspec', RSPEC_VERSION
gem 'rspec-core', RSPEC_VERSION, :require => 'rspec/core'
gem 'rspec-expectations', RSPEC_VERSION, :require => 'rspec/expectations'
gem 'rspec-rails', RSPEC_VERSION
gem 'ansi'
gem 'turn'
gem 'minitest'
end
group(:doc) do
gem 'dm-visualizer', '~> 0.1.0'
end
這不是原始游戲文件,我將此游戲文件添加到另一個包中,即 rubocop。 因為在我收到消息“Rake Aborted:需要 Rubocop / task_file。你可以注意到” gem 'rubocop', require: false”
# Snorby - All About Simplicity.
#
# Copyright (c) 2012 Dustin Willis Webber (dustin.webber at gmail.com)
#
# Snorby is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Foobar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Foobar. If not, see <http://www.gnu.org/licenses/>.
require "./lib/snorby/dm/types"
require "./lib/snorby/jobs"
require "./lib/snorby/worker"
namespace :snorby do
desc 'Setup'
task :setup => :environment do
Rake::Task['secret'].invoke
# Create the snorby database if it does not currently exist
Rake::Task['db:create'].invoke
# Snorby update logic
Rake::Task['snorby:update'].invoke
end
desc 'Update Snorby'
task :update => :environment do
# Setup the snorby database
Rake::Task['db:autoupgrade'].invoke
# Load Default Records
Rake::Task['db:seed'].invoke
# Restart Worker
Rake::Task['snorby:restart_worker'].invoke
end
desc 'Update Snorby DB'
task :dbupdate => :environment do
# Setup the snorby database
Rake::Task['db:autoupgrade'].invoke
# Load Default Records
Rake::Task['db:seed'].invoke
end
desc 'Remove Old CSS/JS packages and re-bundle'
task :refresh => :environment do
`jammit`
end
desc 'Start Snorby Worker if not running'
task :start_worker => :environment do
if Snorby::Worker.running?
exit 0
end
# otherwise, restart worker.
Rake::Task['snorby:restart_worker'].invoke
end
desc 'Restart Worker/Jobs'
task :restart_worker => :environment do
if Snorby::Worker.running?
puts '* Stopping the Snorby worker process.'
Snorby::Worker.stop
end
count = 0
stopped = false
while !stopped
stopped = true unless Snorby::Worker.running?
sleep 5
count += 1
if count > 10
STDERR.puts "[X] Error: Unable to stop the Snorby worker process."
exit -1
end
end
unless Snorby::Worker.running?
puts "* Removing old jobs"
Snorby::Jobs.find.all.destroy
puts "* Starting the Snorby worker process."
Snorby::Worker.start
count = 0
ready = false
while !ready
ready = true if Snorby::Worker.running?
sleep 5
count += 1
if count > 10
ready = true
end
end
if Snorby::Worker.running?
Snorby::Jobs.find.all.destroy
puts "* Adding jobs to the queue"
Snorby::Jobs.run_now!
else
STDERR.puts "[X] Error: Unable to start the Snorby worker process."
exit -1
end
end
end
desc 'Soft Reset - Reset Snorby metrics'
task :soft_reset => :environment do
# Reset Counter Cache Columns
puts 'Reseting Snorby metrics and counter cache columns'
Severity.update!(:events_count => 0)
Sensor.update!(:events_count => 0)
Signature.update!(:events_count => 0)
puts 'This could take awhile. Please wait while the Snorby cache is rebuilt.'
Snorby::Jobs.reset_cache(:all, true)
end
desc 'Hard Reset - Rebuild Snorby Database'
task :hard_reset => :environment do
# Drop the snorby database if it exists
Rake::Task['db:drop'].invoke
# Invoke the snorby:setup rake task
Rake::Task['snorby:setup'].invoke
end
end
這個文件/lib/tasks/snorby.rake
此圖像輸出:
RAILS_ENV=生產包 exec rake snorby:setup
編輯:解決了我的問題。 你必須安裝:
gem install bundler -v 1.17.1 gem install rails -v 4.2.2 gem install sprockets -v 3.7.2 gem install rake --version=0.9.2
或者如果您想安裝 Suricata、Snorby 和 barnyard2。 我建議你遵循這個: 指導安裝
很可能您已將Snorby
安裝到特定環境中,
請復制/粘貼您的“Gemfile”,以便我們查看。
您還可以通過以下方式列出production environment
中的所有 rake 任務
RAILS_ENV=production bundle exec rake -vT
更新:
Snorby
似乎是一個獨立的 Web 應用程序,因此 rake 任務被定義為任何其他自定義 rake 任務
您應該能夠找到lib/tasks/snorby.rake
文件,如果沒有,我建議您從以下位置重新下載 repo: https : //github.com/Snorby/snorby/snorby ,並按照README.md
的說明進行操作README.md
另一個更新:該項目自2017年11月13日起似乎停止更新,仍有122個問題未解決,我個人不會使用該項目進行網絡安全監控。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.