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

Run a rake task rails

I am trying to get a rake task to run, basically a screen grab and then post the data to a model. I have a task but not sure on how to get it to run namespace :grab do task :fixtures => :environment…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
0
votes
0 answers

Rake task imports one line only of txt file

I wrote many simple rake files to import txt files to my mysql. Everything work perfectly except one model. I have no errors so I don't know what happening. The rake imports the first line only. Everything else don't! The txt is on UTF8 encoding, by…
maiconsanson
  • 243
  • 3
  • 16
0
votes
2 answers

Removing duplicates with rake task

There's a lot of similiar questions like this, but couldn't find good answer for me. I have EntryVote model with fields user_id, entry_id and some others. I want to create simple rake task to remove duplicates for user_id, entry_id groups (doesn't…
Marcin Doliwa
  • 3,639
  • 3
  • 37
  • 62
0
votes
2 answers

rake aborted! uninitialized constant User::UserGroup

I am having a strange problem where my rake task is running on my local machine but not in production. Getting the following error when try the same in PRODUCTION rake aborted!uninitialized constant User::UserGroup when I ran the trace on it got…
0
votes
3 answers

Rake task not adding CSV to database

I'm trying to add rows of a CSV to records in a table and everything seems to be working fine besides the fact that nothing actually shows up. Here is my Rake task: namespace :csv do desc "Import CSV Data" task :c_up => :environment do …
Jason
  • 3,330
  • 1
  • 33
  • 38
0
votes
1 answer

is it possible to run rake tasks from another server in rails

I have a bookmarking website developed in ruby on rails 3.0.7 and many rake file are running every time to get bookmarked URLs details and added users informations. Since rake are running every time, my server got engaged and its CPU utilization is…
Anu
  • 9
  • 1
0
votes
1 answer

Neo4j rake aborted! No such file or directory - wget http://dist.neo4j.org/neo4j-community-1.7-unix.tar.gz

Trying to install and run a simple Neo4j app from Max Demarzi's "d3_js_intro" app on GitHub. Issuing the command rake neo4j:install, I get the message shown below. Questions: Q: What is the root cause of wget failing to get the file; a file that…
HisHighnessDog
  • 468
  • 4
  • 10
0
votes
1 answer

Faker "Don't Know How to Build Task?

I checked out the questions that have already been asked on this subject, "There are many", but I do not find a solution. I have a fairly large task and the files name is 'sample_employee_data.rake'... so here goes: namespace :db do …
thomasvermaak
  • 302
  • 5
  • 16
0
votes
1 answer

rake task with multiple parameters - I got stuck

The rake task itself: desc "This task creates a new user" task :create_user, [:email, :password] => :environment do |t, args| trole = Role.find_by_name('translator') User.create( :email => args.email, :password => args.password, …
Paul
  • 25,812
  • 38
  • 124
  • 247
0
votes
1 answer

RubyOnRails: How to make rake task to parse Twitter JSON?

I am trying to write a rake task to parse a file containing lots of twitter updates in json format. The json file looks like this: { "_id" : { "$oid" : "50f82aeab4aa879861000000" }, "text" : "Golden Globes, lots of fashion messes...but glad Argo…
sbolel
  • 3,486
  • 28
  • 45
0
votes
2 answers

How to set two foreign keys with a Rake Task in Ruby on Rails?

I have a rake task to create a number of invoices in my Rails application: def make_invoices Project.all.each do |project| i = project.invoices.create!( :number => random_number, :date =>…
Tintin81
  • 9,821
  • 20
  • 85
  • 178
0
votes
1 answer

rake task: Undefined method for Class

I have added a new task to my RakeFile (I know the new way of doing it is to add your task to lib/tasks, but other tasks are in the RakeFile and I dont wish to refactor just yet.) The task that I added accesses a model (maybe not though as the model…
Christian
  • 3,917
  • 2
  • 23
  • 40
0
votes
2 answers

Rails - Update attributes using rake task. Need help troubleshooting model method code

I am trying to use a rake task that will run every night (using Heroku Scheduler) and update some attributes if some certain criteria is met. A little logic about the application: The application allows users to "take the challenge" and read a book…
Trevan Hetzel
  • 1,371
  • 7
  • 21
  • 42
0
votes
0 answers

Can't add Heroku scheduler add-on

In my Rails app, I have a rake task that I want to run periodically. When I try to add the Heroku scheduler add-on to my app, I get this error: "Could not create resource with vendor, please try again later" This happens both through the web…
Andrew
  • 2,425
  • 2
  • 24
  • 35
0
votes
1 answer

TASK: Rake aborted! Could not find table 'currencies'

I have deployed my rails app to Linode VPS, using capistrano but thaere is a little snag which I dont know how to solve: Capistrano output during deployment: == CreateCurrencies: migrating -- create_table(:currencies) -> 0.0074s == …
user1139144