rake Questions

4

Solved

I'd like my :default task in a Rakefile to be a helpful message that also includes the list of available tasks (the output of rake -T) for people who are not as familiar with rake. How do you invo...
Tell asked 30/4, 2011 at 19:58

6

Solved

I want to invoke my rake task from console. Is it doable? if yes, how to do so? I tried this on console: require 'rake' Rake::Task['my_task'].invoke but it give me this error: RuntimeError: Do...
Stockist asked 28/1, 2011 at 10:4

12

Solved

I have been working with Rails and it sends me back this error. Please provide questions. Thanks for all the help. I will update this question with a better one because I don't know how to ask it. ...
Habitue asked 22/5, 2014 at 8:44

22

Solved

I have a rake task that needs to insert a value into multiple databases. I'd like to pass this value into the rake task from the command line, or from another rake task. How can I do this?
Pedigree asked 5/5, 2009 at 16:27

3

Solved

I was investigating using the Rake build tool to automate running unit tests. I searched the web, but all the examples were for using rails. I usually just write small command-line programs or simp...
Zombie asked 26/1, 2012 at 11:1

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

1

I am trying to setup a Rake Task (without rails), and thus created a demo Hello World Task. However, upon running rake -T or rake --tasks nothing is returned, as if the task hasn't been identified....
Vociferant asked 9/8, 2022 at 9:32

5

Solved

I have a rake task that is called from another rake task. In this rake task I need to ask the user for some text input, and then, depending on the answer either continue, or stop everything from c...
Electrotechnology asked 7/3, 2011 at 14:42

5

Solved

I had read through a rails book and once found we can add # TODO: and some # stuff in codes, so we can you some rake cmd to look back. My problems is I can't find where are those "# stuff&quot...
Gooseflesh asked 7/11, 2009 at 17:39

9

In a rake task if I use puts command then I see the output on console. However I will not see that message in log file when app is deployed on production. However if I say Rails.logger.info then i...
Incurvate asked 11/2, 2010 at 17:5

10

Hello, I have problem with ActionMailer, when I try to execute action: rake send_email I get a error: rake aborted! ActionView::MissingTemplate: Missing template user_mailer/mailer with "m...
Takin asked 22/6, 2015 at 15:50

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

3

Solved

I would like to update a cities table every week to reflect changes in cities across the world. I am creating a Rake task for the purpose. If possible, I would like to do this without adding anothe...
Floccus asked 19/9, 2015 at 17:25

1

I'm looking for a python library for replace the rake function from "Survey", an R library (https://www.rdocumentation.org/packages/survey/versions/4.0/topics/rake) I have found and try Q...
Undertenant asked 16/9, 2020 at 9:53

2

Solved

If using the this option in config/application.rb: config.active_record.schema_format = :sql then when you do: rake db:migrate it only dumps the db/structure.sql. I know it isn't using the db...
Federicofedirko asked 30/11, 2012 at 14:8

4

I am running a command using sh and need to read the output of that command. e.g. sh "whoami" But sh only seems to return true rather than a string containing the output of the whoami command. Do...
Brocatel asked 17/9, 2009 at 23:41

21

Solved

What's the best way to run scheduled tasks in a Rails environment? Script/runner? Rake? I would like to run the task every few minutes.
Aged asked 12/11, 2008 at 22:59

4

Solved

1) Is there a 'best' place for rake tasks inside of gems? I've seen them in /tasks, /lib/tasks, and I've seen them written as *.rb and *.rake -- not sure which (if any) is 'correct' 2) How do I ma...
Corsetti asked 10/12, 2009 at 4:29

7

I have Rails project. When I try to run any rake task or rails server it give me this error env: ruby\r: No such file or directory Could someone help me?
Premedical asked 16/3, 2015 at 9:54

5

Solved

I have a problem with pushing my migrations to the production database. The issue: I've altered database schema by adding 1 column. I've migrated it to the production database: MacBook-Air-Mac:...
Gonzalogoo asked 1/4, 2013 at 4:53

3

Solved

I'm trying to write tests in rspec for two rake tasks which are defined in the same file (in a Rails 3.0.11 project). For some reason only one of them passes. I've written a small demo to abstract ...
Spirillum asked 8/9, 2012 at 22:58

2

Rake has added an order_only feature in 13.0, which is probably based on GNU Make's order-only prerequisites. Information on how order-only prerequisites should work is further clarified in this qu...
Sinker asked 30/12, 2021 at 6:14

3

Solved

Does anyone know the easiest way to run a rake task for a Rails app on an Elastic Beanstalk environment? I have some data that I want to reset every once in a while (timeline TBD). I've seen othe...

2

I just joined a project developing a rails engine, that also has a dummy app for testing. foo/ foo/spec/dummy/ There are identical migrations in foo/db/migrate/ foo/spec/dummy/db/migrate/ If ...
Retinoscopy asked 22/1, 2013 at 18:44

© 2022 - 2025 — McMap. All rights reserved.