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

Resque - rake aborts

Iam new to ruby on rails, currently iam trying to make my task to run at background using resque gem I had installed redis and resque gem successfully, Now i want to run my rake file which is placed at .../lib/tasks/resque.rake content in…
Mothirajha
  • 1,033
  • 1
  • 10
  • 18
0
votes
1 answer

Ranking with mongoid

I have a School and Result model where results belong to schools, and schools have results for every year. Each result has a field :score, and I am trying to rank each 'result' by its score but only for each year. So there will be different rankings…
Jeremy Lynch
  • 6,780
  • 3
  • 52
  • 63
0
votes
1 answer

Rake task to import sql database on localhost database

I try to import some data to my localhost project and i dont know what to do. My task for this look like this right now: desc "imports the devel databse dump file to www2_sw" task :dumpimport => :environment do puts "Loading…
Wordica
  • 2,427
  • 3
  • 31
  • 51
0
votes
0 answers

Error while running jobs:work with RAILS_ENV=production

I am getting the following error while running jobs:work rake task with RAILS_ENV=production option C:\RailsProject>rake jobs:work RAILS_ENV=production --trace (in C:/RailsProject) ** Invoke environment (first_time) ** Execute environment ** Invoke…
Sravan Kumar
  • 673
  • 1
  • 7
  • 12
0
votes
1 answer

Rails: preventing spec files from being initialized during rake tasks

I have a Rails app with a spec folder full of rspec tests. Many of them reference resources in my app, such as the 'User' resource. Everything is fine on my machine, but when I try to setup the app on a new machine and build the database with rake…
Andrew
  • 2,425
  • 2
  • 24
  • 35
0
votes
1 answer

Accessing model attributes within a rake task

I was wondering how to access a Models attributes and then run in a rake task using some methods, from what i have read methods have to be declared outside of the task, but gaining access to the model is throwing me I know that if i put this…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
0
votes
1 answer

Rake task with minitest-spec-rails gem

I have been using the minitest-rails gem, and everything works great when I run: rake minitest:models However, I recently switched to the minitest-spec-rails gem, and when I run that same command I get this error: "Don't know how to build task…
hellion
  • 4,602
  • 6
  • 38
  • 77
0
votes
1 answer

rake task return on calling task

I would like to return from a rake task in the calling task. Does it possible? Something like in this example, i would like to be able to call task one and one independantly but also one and two sequentially. task: one do some work if work ok …
7vingt
  • 301
  • 2
  • 16
0
votes
1 answer

Can I run Solr server without running rake command for rails application?

Is there any alternate way for running solr server without running rake command for rails application like providing all those solr related classes into single jar and then use that jar. Please suggest some of the solutions regarding this Thanks
Sravan Kumar
  • 673
  • 1
  • 7
  • 12
0
votes
1 answer

Rake - capture :task_name as an option?

I am watching a Peepcode screencast Play by Play: Jim Weirich. He executes a rake task that appears to pass the final task name as an option. See how the task :demo creates a "demo" folder. How was this done? EDIT: Thanks, Alex.Bullard. So with…
seanomlor
  • 973
  • 1
  • 10
  • 23
0
votes
1 answer

Getting Heroku to precompile assets to Amazon aws s3

Almost there with my issue of getting AWS S3 to serve my heroku app its static assets Everything works locally, i run my rake task and then the assets get precompiled to AWS ( though there is never any output in the terminal?) Then to heroku, where…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
0
votes
2 answers

Import CSV to existing sqlite database table

I've searched all over this forum for solution to the above problem, but everything I tried didn't work. Basically, i have a model Library, with corresponding libraries table in my sqlite3 database. I have a csv file named libraries.csv which…
Shikasan
  • 331
  • 1
  • 6
  • 20
0
votes
1 answer

Debugging why a create method is not saving to the model

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.destroy_all get_home_fixtures.each {|home|…
Richlewis
  • 15,070
  • 37
  • 122
  • 283
0
votes
1 answer

Invoking rake with whenever

I just started using Rails Whenever plugin. I have rake file cron. with task: task :cron => :environment do puts "Task invoked!" end And in schedule.rb I have this: every 2.minutes do rake "cron", enviroment => "development" end Once I…
rastko
  • 567
  • 9
  • 24
0
votes
1 answer

elasticsearch stops indexing new documents after a while, using Tire

I have my website running, with ElasticSearch, using Tire. In the background, I have a rake task that is looping over thousands of objects and creating one record for each of them. At first, the records are indexed, and every time I refresh my…
Robin
  • 21,667
  • 10
  • 62
  • 85