rake-task Questions
5
Solved
I don't know wtf is going on but I just created a new Rails app and can't get any rake tasks to work or show up in $ rake -T
lib/tasks/hello.rake
namespace :hello do
desc "hello"
task :you do...
Fruiterer asked 20/5, 2017 at 13:25
5
How can I return some value from a Rake task in ruby.
Sample code:
namespace tasks
task task1: :environment do |task|
log = "Running task"
puts log
log << "Done"
return log # suggest h...
Mortality asked 2/4, 2017 at 11:26
2
Solved
task :some_task, :environment do |t, args|
puts Rails.env #=> development, production, etc
puts ENV #=> {}
end
I set some environment variables (either via a local .env, or via Heroku Con...
Manila asked 28/3, 2013 at 19:6
5
Solved
I have a problem when I do:
namespace :xaaron do
task :get_roles do
roles = Xaaron::Role.all
puts roles
end
task :get_role, [:name] do |t, args|
role = Xaaron::Role.find(args[:name].paramet...
Entertaining asked 11/12, 2014 at 20:9
3
Solved
I am trying to write a Rspec test for one of my rake task, according to this post by Stephen Hagemann.
lib/tasks/retry.rake:
namespace :retry do
task :message, [:message_id] => [:environment...
Mattie asked 12/10, 2015 at 17:23
25
I saw this question up before, but only for rspec. I haven't created test yet because it's too advanced for me but one day soon i will! :P
I get this error when I try to sign-up/login into my app....
Aquaplane asked 30/9, 2013 at 15:3
2
Solved
How to send such a query to database server from Rake task without removing record-by-record in "each" loop?
delete from data
where uuid in (
select uuid
from data
group by uuid, raw, recdate
...
Blotto asked 15/5, 2012 at 10:33
2
Solved
I'm trying to run the command rake db:migrate but I keep getting this error:
/Users/[name]/.rvm/gems/ruby-2.2.1/bin/rake:23:in `load': cannot load such file -- /Users/[name]/.rvm/rubies/ruby-2.2.1...
Sadirah asked 17/8, 2015 at 14:50
2
I am coding a rake task which function is getting info from other webpage. To do that I use open-uri and nokogiri. I have tested in development and it does the job, but then I deploy to the product...
Ifc asked 4/2, 2020 at 20:33
1
I configured my environment properly to debug rails apps in VS Code.
It works fine for debug Rails Server. When I start the debug, it boots the server and stop at the breakpoints that I have marke...
Haematogenesis asked 19/11, 2019 at 18:50
4
Here is my rake task
namespace :users do
task :change_role, [:role] => :environment do |t, args|
puts args.role
end
end
I am calling it like this:
rake users:change_role["role"] but I am ...
Gambrill asked 3/7, 2014 at 15:3
4
Solved
I have a rake task test that I setup following the only examples I could find online.
It looks like this:
require 'test_helper'
require 'minitest/mock'
require 'rake'
class TestScrapeWelcome <...
Putty asked 25/7, 2015 at 2:35
5
Solved
I have this simple rake task which refuses to run. I just don't see why it looks correct. Who can pinpoint me to the probably very simple mistake I made? Thank you!
/lib/tasks/reindex.rb:
namespa...
Finally asked 15/10, 2012 at 19:57
3
Solved
I want to test a method defined in a rake task.
rake file
#lib/tasks/simple_task.rake
namespace :xyz do
task :simple_task => :environment do
begin
if task_needs_to_run?
puts "Lets run this...
Chadd asked 20/1, 2012 at 10:58
8
Solved
I'm using ruby's File to open and read in a text file inside of a rake
task. Is there a setting where I can specify that I want the first line of
the file skipped?
Here's my code so far:
desc ...
Nock asked 8/3, 2012 at 8:4
3
I am doing a cron tab in AWS - Elastic Beanstalk with Ruby on Rails 3, but I don't know what is wrong.
I have this code in my .ebextensions/default.config
container_commands:
01remove_old_cron_j...
Disinfectant asked 21/11, 2013 at 9:57
2
This is my command
bundle exec rake resque:work QUEUE="*" --trace
I want to run this command on my server as a background process.
please help me.
Hustle asked 29/5, 2013 at 14:27
2
My rails4 application is running with docker. It runs a rake task for fetching messages from AWS SQS.
The problem I met is that logs can't show up in a console in time. The console doesn't show an...
Public asked 5/4, 2016 at 5:33
3
Solved
I use crontab to invoke rake task at some time for example: every 3 hour
I want to ensure that when crontab ready to execute the rake task
it can check the rake task is running. if it is so don't...
4
Solved
Reffering that answer I was trying to use OptionParser to parse rake arguments. I simplified example from there and I had to add two ARGV.shift to make it work.
require 'optparse'
namespace :user...
Doehne asked 23/1, 2015 at 12:52
4
I am working on a multi-database Rails 3 application. Each database has a different schema (and in production are located in different locations). I've set the app to talk to different databases li...
Croze asked 23/2, 2011 at 2:20
5
Solved
I'm importing an existing rails project that I was working on into my new arch linux system, I already installed all gems and postgresql correctly, but I having some issues when runing:
rake db:cr...
Imogen asked 28/4, 2011 at 15:38
2
Solved
i need some help :(
well, i need to pass 1 parameter to a rake task. And I'm not 100% sure how to do this, I've tried a lot of things, but nothing actually works.
it's look like this :
{ ta...
Fabron asked 4/1, 2016 at 20:22
5
Solved
Is it possible somehow to execute rake task only if it is not running already,
I want to use cron for executing some rake tasks but rake task shouldn't start if previous call is not finished
Thanks...
Burmeister asked 6/9, 2011 at 13:54
2
Solved
I would like to be able to pass arguments for a task that I have to call from another task
Invoking without arguments works for me like this:
Rake::Task["mytask1"].invoke
However with arguments...
Haematopoiesis asked 6/8, 2015 at 14:50
1 Next >
© 2022 - 2024 — McMap. All rights reserved.