rake-task Questions

1

Solved

I have a rake task to generate a given amount of items in a xml file. If nothing is given I want to have a default. By now only 50 gets printed, but I would like to have a variable amount here, how...
Imbalance asked 30/7, 2015 at 18:9

0

I'm trying to send mail from a rake task. I've already manage to send email but the problem is the file I send. I want to send a view which will be modify each time that the mail will be send. I'...
Ewing asked 9/6, 2015 at 7:5

2

I am trying to get my heads "dirty" with TDD and for some reason when I run bundle exec rake test on the command line, nothing happens. Here is my RakeFile: require 'rake/testtask' Rake::TestTas...
Jaundiced asked 16/1, 2013 at 16:22

1

Solved

Well, I have elasticsearch-rails gem installed (version 0.1.5) and I can clearly see the task inside the gem files. But when I run bundle exec rake environment elasticsearch:import:model CLASS='...
Sulla asked 16/9, 2014 at 20:10

3

Solved

I have the rake tasks in my rails application. i want to run a commandline commands with in rake task. how can i do this. i tried by the following but fails desc "Sending the newsletter to all th...
Banneret asked 8/9, 2010 at 14:13

1

I have an Ruby 2.1/Rails 3.2 application which uses the asset pipeline. We are also using a fragile (alpha) gem which causes "rake assets:precompile" to fail at times. I would like to write an rspe...

8

Solved

I am getting the error rake db:migrate --trace rake aborted! You have already activated rake 10.1.1, but your Gemfile requires rake 10.1.0. Using bundle exec may solve this. /Users/iang/.rvm...
Morpheme asked 21/12, 2013 at 2:11

2

Solved

I've written a custom database adapter that works correctly and effectively when a rails server is running. I would now like to add the usual rake task definitions for creating, dropping and migrat...

2

Solved

My Environment Vanilla Ubuntu 12.10, no rvm or renv. > gem --version 1.8.23 > ruby --version ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] > bundle --version Bundler versio...
Warrenwarrener asked 7/11, 2012 at 3:10

2

Solved

My webapp needs to encrypt its session data. What I setup is: config/initializers/encryptor.rb: require 'openssl' require 'myapp/encryptor' MyApp::Encryptor.config[ :random_key ] = OpenSSL::Rand...
Prudy asked 22/9, 2011 at 0:15

1

Solved

I can invoke a Rake task and set a single environmental variable like this: $ ONE=1 rake temp:both But how do I set two environmental variables? This doesn't work: $ ONE=1 TWO=2 rake temp:bot...
Anticlerical asked 4/2, 2014 at 22:14

2

Solved

I want to use ActionMailer in my rake task in order to send emails to people at a particular time. I have written a mailer class in app/mailers folder like this: class AlertsMailer < ActionMa...
Snipes asked 30/1, 2014 at 12:42

3

Solved

In my Rails application I have a file sample_data.rb inside /lib/tasks as well as a bunch of test files inside my /spec directory. All these files often share common functionality such as: def ra...

3

Solved

1 namespace :db do 2 desc "Fill database with sample videos" 3 task :populate => :environment do 4 require 'faker' 5 Rake::Task['db:reset'].invoke 6 100.times do |n| 7 headline = Faker::L...
Yann asked 17/3, 2011 at 3:20

2

Solved

I've been trying to run rake db:test:clone_structure, but it keeps failing to rebuild the database. I finally looked at the task itself: task :clone_structure => [ "db:structure:dump", "db:test...
Octennial asked 8/4, 2013 at 20:31

1

Solved

On the terminal, is there a rake task to list all the migrations which have been run on a particular model? If not, how do I go about building one? When I ran rake -T, rake db:migrate:status seeme...
Ecclesiasticism asked 12/9, 2013 at 11:4

1

Solved

There are a lot of threads on here about this already I know but none of the titles have this worded exactly like I did. I hope that we can clear this up a bit. $:.unshift(File.expand_path("../../...
Pinpoint asked 7/9, 2013 at 18:38

1

Solved

I'm attempting to create a rake task that takes a required first argument, and then any number of additional arguments which I want to lump together into an array: rake course["COURSE NAME", 123, ...
Hinds asked 6/9, 2013 at 14:33

2

Solved

I'm using Whenever gem to run a rake task. When I run rake task it runs under development environment, but when it runs on a scheduled time it refers to a production environment. How can I force to...
Create asked 28/6, 2013 at 5:2

1

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 =&gt...
Ignite asked 5/2, 2013 at 17:46

3

Solved

I have a string with extra whitespace: First,Last,Email ,Mobile Phone ,Company,Title ,Street,City,State,Zip,Country, Birthday,Gender ,Contact Type I want to parse this line and remove the whites...
Semifinalist asked 21/1, 2013 at 15:31

1

Solved

I have this method which after a rake task should save my data to the model, I am trying to update 2 columns at a time, which shouldnt be a problem def update_fixtures #rake task method Fixture....
Renaldorenard asked 13/3, 2013 at 13:17

3

Solved

I have a script which in need to run on my data. I have made a rake task for that. If i start the rake task by using heroku run rake my_task:my_action and after a while my internet disconnects. Wha...
Brunette asked 15/2, 2013 at 12:33

2

Solved

I have seen examples where a task has parameters and a dependency task like: task :name, [:first_name, :last_name] => [:pre_name] do |t, args| args.with_defaults(:first_name => "John", :las...
Selfsacrifice asked 20/4, 2011 at 21:20

2

Solved

Is there a way to export database structure in the database from the rails application? I believe there is a way to export Data from the db using rake. rake db:migrate will create tables from migr...
Chilt asked 18/9, 2011 at 1:43

© 2022 - 2024 — McMap. All rights reserved.