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

Defer exceptions in multiple rake tasks

I am new to Rake. I am writing a series of tests to validate data stored in YAML files. Each test is a separate rake task. My problem is this: I would like a single exception to be raised at the end in the case of multiple test failures. It seems…
Alex Harvey
  • 14,494
  • 5
  • 61
  • 97
0
votes
1 answer

Rake Task doesn't load Model with Paperclip

In a rake task for production to migrate some assets I want to require a model that uses Paperclip. But I get the error NoMethodError: undefined method `has_attached_file' for…
Yo Ludke
  • 2,149
  • 2
  • 23
  • 38
0
votes
1 answer

How do I implement a custom buildr task defined externally?

I have a task which I'm trying to refactor into an external module so that I can later separate it from this project and use it for other projects. When I try to run my task, I get an error: Buildr aborted! NoMethodError : undefined method `path_to'…
Hakanai
  • 12,010
  • 10
  • 62
  • 132
0
votes
1 answer

How to drop all databases located in mongoid.yml from rake task?

I want to drop all database sessions which located in mongoid.yml from rake task. I am using rails4 and mongoid4. Here is my mongoid.yml: development: sessions: default: database: cp1_dev hosts: - localhost:27017 …
zeitnot
  • 1,304
  • 12
  • 28
0
votes
2 answers

ruby rake tasks in a namespace shared but not :all

I am tooling the following rake file: namespace :build do desc 'Build development application to the build dist directory' task :default do Rake::Task[:delete].invoke end task :development do verbose(false) do …
Chris Hough
  • 3,389
  • 3
  • 41
  • 80
0
votes
1 answer

How to troubleshoot heroku rake tasks

I have rake tasks that work fine in localhost. When i run rake task:task_name it executes fine. In heroku, when i run heroku run rake task:task_name it does not execute. Logs doesn't seem to contain information on this. Is there somewhere I can…
brad
  • 1,675
  • 2
  • 16
  • 23
0
votes
1 answer

Rails Error: `method_missing': undefined method `register_middleware'

On Rails, I'm trying to rake a new task I just created and it's giving me an undefined method error: syck has been removed, psych is used instead rake aborted! NoMethodError: undefined method `register_middleware' for…
0
votes
2 answers

LoadError when called rake task with RAILS_ENV=test

I am using Ruby 2.1.1 and rails-4.1.0 with Spring. I cannot launch rake with RAILS_ENV=test attribute. For some reasons rake command RAILS_ENV=test rake db:migrate lead to the following…
Mihail Davydenkov
  • 1,861
  • 2
  • 19
  • 33
0
votes
2 answers

OpenVZ web panel cron gives ERROR: 'rake/rdoctask'

I'm using OpenVZ on CentOS 6.5 64bit and every morning I'm getting message with following content: /etc/cron.daily/owp.cron: /usr/lib64/ruby/gems/1.8/gems/rake-10.1.1/lib/rake/rdoctask.rb:2: ERROR: 'rake/rdoctask' is obsolete and no longer…
Besik
  • 43
  • 7
0
votes
2 answers

How to get the over all rake test result in file

I am running a rake task for the more number of operations. Eg: rake test:sample Finished in 66.951185957 seconds. 1 tests, 256 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 100% passed 0.01 tests/s, 3.82…
Galet
  • 5,853
  • 21
  • 82
  • 148
0
votes
1 answer

psql: FATAL: Peer authentication failed for user "expman"

I'm trying to restore a database from backup but I can't connect to postgresql. namespace :db do task import: :environment do import_path = "~/backups" sql_file = "PostgreSQL.sql" database_config =…
enter08
  • 943
  • 1
  • 8
  • 11
0
votes
1 answer

Error while trying to run rake db:migrate on PostgreSQL

I have installed my site on a new server and have installed postgresql. now i am trying to rake the database. and get the following error: I have this on CentOS 6.5 with ruby 1.93 and Ruby on Rails 3 [root@digihaul3-pc current]# rake…
Big Al Ruby Newbie
  • 69
  • 1
  • 2
  • 14
0
votes
1 answer

Rails Rake Task CSV Import is slow

I am working through importing csv files through rake tasks (as per my question here the other day). namespace :csvimport do desc "Import Products CSV Data." task :products => :environment do ActiveRecord::Migration.drop_table products …
Jay Killeen
  • 2,832
  • 6
  • 39
  • 66
0
votes
0 answers

Accessing PostgreSQL database in Ruby on Rails rake task

I'm populating my PostgreSQL using a Ruby on Rails rake task. I'd like to use a PostgreSQL array function (specifically, text_to_array) on every cell in my data table. How do I do so? Can I do so within the rake task? See related: Rails - import CSV…
0
votes
1 answer

Cannot Load Such File -- sqlite3 Ruby on Rails

rake aborted! cannot load such file -- sqlite3 /var/www/BookBuilder/releases/20140317160018/vendor/cache/ruby/1.9.1/gems/backports-3.6.0/lib/backports/tools.rb:343:in…