Questions tagged [rake-task]

Task is the basic unit of work in a Rakefile.

Tasks have associated actions (possibly more than one) and a list of prerequisites. When invoked, a task will first ensure that all of its prerequisites have an opportunity to run and then it will execute its own actions.

Tasks are not usually created directly using the new method, but rather use the file and task convenience methods.

689 questions
0
votes
1 answer

whenever + delayed_job with cron job in starting worker

I am learning cron job and delayed job, and I want to send emails using background job; for that I'm using the delayed_job gem. I don't want to start the worker manually by running the rake jobs:work command, but I want to set this rake in cron job…
urjit on rails
  • 1,763
  • 4
  • 19
  • 36
0
votes
1 answer

A rake task by .rake file

I have the following Rakefile in a Ruby 1.9.3 project: require 'rake/testtask' require 'json' Rake::TestTask.new do |t| t.pattern = "spec/**/*_spec.rb" t.verbose = true end task :default => :test namespace :omglol do namespace :file_a do …
T5i
  • 1,470
  • 1
  • 18
  • 34
-1
votes
1 answer

How to run rake task but running process continue in many days with rails?

In my rails project, I am going to update longitude and latitude field of location table, but I want to update 100 records each day until end of records. Who can give me a suggest?
Hung
  • 459
  • 5
  • 15
-1
votes
1 answer

Rails: rake task change column values in database

I have a column name "password" on my db some password has exclamation point(!) character how can i change the exclamation mark (!) character with dollar sign ($) using rake task? This is my code so far: namespace :update_db do desc "Change !…
ar em
  • 434
  • 2
  • 5
  • 18
-1
votes
1 answer

Failed to launch child process

When I try to run a test on Chrome (selenium / Ruby) then I get the following error. Could anybody help to resolve this? Error :- Background: Login to app # tests\integration\channels.feature:3 …
-1
votes
1 answer

how can i trigger a rake task on every 4th sunday of every month in rails?

i am having a rake task. i want that task to be scheduled to run on every 4th Sunday of every month. i am using whenever gem. how can i define logic in config/schedule.rb so that it will run on every 4th Sunday of every month in Rails? please help…
John
  • 1,273
  • 3
  • 27
  • 61
-1
votes
1 answer

Rake task for pushing local file to GitHub

I have a yml file in my local project, stored in config/locales/en.yml. I want to create rake task to push this file to GitHub, overwriting the existing file. How can I accomplish this?
huynhthinh
  • 37
  • 5
-1
votes
1 answer

Uninitialized constant Error while working with mongoid gem

I have started working with mongoid gem but I am getting an Uninitialized constant error I have defined a document Tweet class Tweet include Mongoid::Document field :tweet_id, type: Int field :created_at, type: DateTime field :text,…
Ashish Singh
  • 739
  • 3
  • 8
  • 21
-1
votes
1 answer

Crontab error while trying to run a rake task - Using whenever gem

I have created a simple rake task. I am trying to use https://github.com/javan/whenever/ gem to run this task once a day. However, no tasks are being fired. In my /var/mail/* file, From: root@Gupta (Cron Daemon) To: shubham@Gupta Subject: Cron…
Nerve
  • 6,463
  • 4
  • 29
  • 29
-2
votes
1 answer

Rake vs Rails in Ruby on Rails

What is the difference between commands rake and rails in Ruby? Which one is faster and why? Is rails duplicate command for rake? Can rails can be used for all tasks performed by rake or there is any limitation?
-2
votes
1 answer

Rails 5, Why am I getting undefined constant when calling a class in a rake task?

I'm using Ruby on Rails 5.1.4, to make a little reporting system. I'm using a Handler class like the following: # app/handlers/report_handler.rb class ReportHandler ROLES = %w[admin staff] def self.queue_reports tennants = Tennant.elite …
Alvaro Alday
  • 343
  • 3
  • 19
-2
votes
2 answers

Where does bundle exec rake db:migrate come from?

I'd to see where this rake task is written and how it finds the db to migrate to.
stackjlei
  • 9,485
  • 18
  • 65
  • 113
-2
votes
1 answer

Ruby - how to create a rake task to search through every line of your project

I'm not sure how to approach this - I'm trying to create a script that will read through every file in a given directory take any lines containing a certain string, let's say 'bla', and copy them to a new file, giving me a file just with lines…
Mark
  • 6,112
  • 4
  • 21
  • 46
-2
votes
1 answer

How to calculate points using SQL not ruby

I have a rake task in my rails app which calculate bonuses: namespace :all_bonus do desc "all given bonuses" task given_bonuses: :environment do points = 0 Bonus.find_each do |bonus| points += bonus.points end puts Bonus.count …
Damir Nurgaliev
  • 341
  • 5
  • 19
1 2 3
45
46