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
2 answers

rake db:seed failing on production server

Can some one make sense of this output? Its been a very long day and my eyes are glazing over. Yesterday it seemed to work fine. rake db:seed --trace rake aborted! cannot load such file --…
bytemonger
  • 83
  • 7
0
votes
1 answer

Rails 3: Unknown attribute

I'm wondering if someone could give me some hints as to why I'm getting an unknown attribute error when trying to create instances of a model I have created (Card). Here is a stripped down version of the model class and the rake task where I am…
binarymelon
  • 904
  • 2
  • 12
  • 26
0
votes
1 answer

Rails parse_url() end of file reached error

I wrote a rake task that is parsing a json into a hash from an API. Relevant code is uri = URI.parse(url) JSON.parse(uri.open.read) When I run this rake task, sometimes I get an "end of file reached" error, which I'm assuming is some form of a…
0
votes
1 answer

Ruby on Rails: rb_class_superclass not located in msvcrt-ruby191.dll (ruby-prof error?)

So, long story short, I had o format and reinstall my OS hence all my dev utilities. git env sorted. DevKit was fine. Sphinx/mysql fine. Bundle installed perfectly. Everything is gravy until I go to rake db:create and build my…
RickyD
  • 401
  • 4
  • 16
0
votes
1 answer

Rake task not running

Every time I call my rake task it say: [2012-07-12 15:50:01] ERROR IOError: An existing connection was forcibly closed by the remote host C:/jruby-1.3.1/lib/ruby/1.8/webrick/httpresponse.rb:324:in `_write_data' …
M.Octavio
  • 1,780
  • 2
  • 25
  • 39
0
votes
2 answers

Rubygem to notify Rake Task is finished

Is there any Rubygem to send an email or push notification after a certain Rake Task is finished? It's good if there is one as I usually do multi tasking and forget to check if a process of Rake task is finished.
suzukimilanpaak
  • 751
  • 2
  • 8
  • 20
0
votes
1 answer

Array of file names: how to move 2 certain files (if present) to the front?

In a build.rake file I have an array holding names of JavaScript files: JS_FROM_INDEX=`./bin/extract_files -e js index.html`.split It holds these files: js/config.js js/vendor/dollar.js js/vendor/ejs.min.js js/utils.js ...... js/Viewport.js Then…
Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
0
votes
1 answer

Rails: Custom Rake Task error => rake aborted! missing :controller

(RoR with Rails 3.1, gem rake 0.9.2.2) I'm trying to run the most basic custom rake task as you can see here: task :update_me => :environment do Product.all.each do |product| puts product.link end end I keep getting the error below. The…
heebee313
  • 325
  • 1
  • 5
  • 16
0
votes
1 answer

trying to upload files using a ruby rake task

So I'm using Spree as my shopping cart in Ruby on Rails. Spree is version 1-1-stable, and Ruby is v1.9.3, and Ruby on Rails is v3.2.3. I have a remote host that has images that I want to download for my Spree cart. This is the code I'm using to…
melissanoelle
  • 112
  • 1
  • 8
0
votes
1 answer

Announce rake stdout with cucumber and aruba

How to tell cucumber/aruba to display the stdout of a rake command. The following code doesn't work for me @announce Scenario: test rake task When I run 'rake -verion' Then the output should contain "0.9.2.2" Even with the @announce tag, the…
jrabary
  • 2,411
  • 1
  • 28
  • 50
0
votes
1 answer

Necessity of cloning classes for background processes running through rake?

I have a resque worker class which works with ActionMailer and another that works with Mail directly. Here's a short example: class NotificationWorker def self.perform(id) Mailer.delivery_method.settings = { # custom settings here …
pdu
  • 10,295
  • 4
  • 58
  • 95
0
votes
1 answer

Setting object expired field to true after comparing expired_date to current date

I'm writing my first rake task for my rails project and I have a very vague idea of how I will implement this. Basically, my goal is to have an automated process (Cron+Whenever) that will run this rake task once a day. The task will iterate through…
Huy
  • 10,806
  • 13
  • 55
  • 99
0
votes
1 answer

make a request to other site from the rake task

I'm trying to automate my database population with sample objects, so I use rake tasks. I would like to use some data from other website pages. I created txt file with url list from where that information supposed to be read and ran into problem: I…
Roaring Stones
  • 1,054
  • 7
  • 22
0
votes
3 answers

ActiveRecord : Delete duplicate records

If there are multiple records on a specific date I want to remove all but latest record on that day. For example in below table records with id 9, 10, 12 have same date. So 9 and 10 should be removed as record with id 12 is having latest date. id …
Amit Patel
  • 15,609
  • 18
  • 68
  • 106
0
votes
3 answers

bundle exec rake routes is not working

When I run bundle exec rake routes, it prints this messages: Faraday: you may want to install system_timer for reliable timeouts rake aborted! undefined method `debug_rjs=' for ActionView::Base:Class Tasks: TOP => routes => environment (See full…
King Pangilinan
  • 597
  • 1
  • 14
  • 26
1 2 3
45
46