rakefile

why rake tasks are not executing using and operator?

若如初见. 提交于 2021-01-29 09:21:33
问题 I have a rake task : task :kill_process do system %q(ps -ef | awk '{if($8~"java" || $8~"glassfish" || $8~"ruby" || $8~"god" || $8~"couch"){printf("Killing : %s \n",$2);{system("kill -9 "$2)};}}') end This is basically killing processes. And this task is a part of another rake task : desc "stop the entire system" task :stop => [...., :kill_process] There's another task: desc "start the entire system" task :start => [....] When I am doing rake stop && rake start stop task is executed

How to execute linux command from rakefile?

依然范特西╮ 提交于 2021-01-28 21:29:31
问题 I have the following command: ps -ef | awk '{if( $8~"java" || $8~"ruby" || $8~"god"){printf("Killing : %s \n",$2);{system("kill -9 "$2)};}};' How do i excute this linux command from rakeFile. I tried: task :kill_process do `ps -ef | awk '{if( $8~"java" || $8~"ruby" || $8~"god"){printf("Killing : %s \n",$2);{system("kill -9 "$2)};}};'` end But on executing it's giving error: awk: cmd. line:1: {if( $8~"java" || $8~"glassfish" || $8~"ruby" || $8~"god" || $8~"couch"){printf("Killing : %s awk: cmd

rake db:migrate not working when using ActiveRecord with Sinatra

倖福魔咒の 提交于 2020-03-04 21:40:09
问题 I am trying to create a very basic Sinatra app which uses only Active Record and Sqlite3. To be as complete as possible I am following instructions from a tutorial which states the following steps in order: Create a database by putting the following code in the main app file: ActiveRecord::Base.establish_connection( :adapter =>'sqlite3', :database=>'wiki.db' ) class User < ActiveRecord::Base validates :username, presence: true, uniqueness: true validates :password, presence: true end To

Using rake import (calling other rakefiles)

随声附和 提交于 2020-01-23 06:26:49
问题 Here's my primary rake file subrake = 'subrake' task :init => [subrake] do #call subrake.build end import subrake I see documentation on how the above steps work, but I can't figure out how to call tasks in the other subrake file. BTW, those tasks may have the same name as mine, is this an issue? 回答1: I guess I'm late with my answer, but I had the same question just few moments ago. So the solution might be useful for someone. Rakefile.rb subrake = 'subrake' task :default => :init task :init

heroku rake db:migrate fails

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 09:59:31
问题 I get the following error: [app (master)]$ heroku rake db:migrate rake aborted! undefined method `root' for Heroku::Rails:Module /app/Rakefile:7 (See full trace by running task with --trace) (in /app) I can't figure out how to run trace as suggested by the error ( heroku rake db:migrate --trace gives "Invalid Option --trace"), and I don't believe this is related to the well-known "heroku doesn't use sqlite3" issue. My Rakefile is as follows: require File.expand_path('../config/application', _

Ruby - create gem: reload console with updated gem content

。_饼干妹妹 提交于 2019-12-21 09:22:14
问题 According to this article, we can test around our gem code by adding those lines to our rakefile: task :console do require 'irb' require 'irb/completion' require 'my_gem' # You know what to do. ARGV.clear IRB.start end It works really well, except that whenever a change is made to the gem, I need to exit and rerun rake console to get the code updated. It is really not convenient as a creation/debugging tool ... Is there a way to write a custom method that would act as the awesome reload!

Ruby/Cucumber: Integration to Jenkins : Bitbucket

∥☆過路亽.° 提交于 2019-12-13 06:57:43
问题 NOTE: Jenkins linked to the machine, where all the automation set up is done, and cucumber test steps can be run with the command cucumber flawlessly. I have a repository in bitbucket, and I am trying to get it run on the jenkins on each change to my repository. Currently, the tests that I have written with cucumber/gherkin and ruby are for mobile automation tests with appium using appium_lib I am trying to get this run in the jenkins but, jenkins would keep displaying the error can't find

rakefile.rb doesn't work correctly

冷暖自知 提交于 2019-12-12 05:28:49
问题 I have the following task task :default => ['build_html'] desc 'Generar documentacion desde markdown' task :build_html do SRC = FileList['*.md'] directory 'html' SRC.each do |md| html = md.sub(/\.[^.]*$/, '.html') file html do sh "markdown #{md} > html/#{html}" end end end It does not work correctly, is supposed to find all files .md, for each file extract only the name, append .html and finally execute markdown file.md > html/file.html . But it doesn't work. It doesn't even create the 'html'

rake db:migrate returns “rake: Is a directory”?

余生长醉 提交于 2019-12-11 12:53:41
问题 I've been searching for the answer to this question for a week, but haven't found one. I'm running Mac OS 10.5.8 if that's relevant. I'm trying to do the Peepcode tutorial "Meet Rails 3" but when I run the command line user$ rake db:migrate I get the following error message: /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake: Is a directory - /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake (Errno::EISDIR) from /usr/local/bin/rake:19:in `load' from /usr/local/bin/rake:19 I found the

Force ruby to hide backtrace on exception

好久不见. 提交于 2019-12-10 18:32:10
问题 I do some usual tasks with Rakefile , such as compilation, linking, etc. When compilation fails ruby shows full backtrace in which task error happen, but it's really useless for me, even more: this backtrace hides compilation errors. $ rake mkdir -p build llvm-as source/repl.ll -o build/repl.bc llvm-as: source/repl.ll:6:22: error: expected value token call i32 @fputc(i8 'x', i32 0) ^ rake aborted! Command failed with status (1): [llvm-as source/repl.ll -o build/repl.bc...] /usr/local/lib/ruby