rake

db:seed not loading models

I'm trying to seed my database with the standard db/seeds.rb method. This works fine on my development machine, but on my server, I get: $ sudo rake db:seed RAILS_ENV=production --trace ** Invoke db:seed (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:seed rake aborted! uninitialized constant Permiss...

Call Application Controller functions from Rake task

Hi, I want to call a function in my ApplicationController from a rake task. I've added the => :environment tag, but it just doesn't want to work. Here is my stripped down code- lib\taks\autoscrape.rake: desc "This task will scrape all the movies without info" task(:autoscrape => :environment) do require 'application' #probably ...

Printing to screen in a rake task

I have a long running rake task. Every now and then I print an update to the screen to let me know how far along the task has come. puts "Almost there..." My problem is all the puts statements seem to buffer somewhere and won't print to the screen until after the task is complete. At which point, they will be printed all at once. Is ...

deploy rake task as if it were a common script

I like the rake task structure and rake utilities.. I want to create a script that can do many things, and rake seems the logical choice. I want to know how can I make it look like a regular script: ./myscript.rb cake:bake as opposed to rake -f myscript.rb cake:bake any idea? Of course, rake must still be installed etc.. simply to ...

How do I resolve a permission error installing a custom built gem?

I'm attempting to build my first ruby gem and all seemed to go well until I attempted to install the gem. I'm using RVM so no need for 'sudo gem install' here. First I attempted to do the following: jim:~/Desktop/spectest \ [git:master] → rake manifest (in /Users/jim/Desktop/spectest) Cleaning - pkg rm -rf pkg Building Manifest Man...

Why can't I create my database using "rake db:create"?

I've recently started reading up on Rails and while getting my development environment ready on Windows, I kept running into problems. So I opted to just work on the server space I have with asmallorange.com. Everything went smoothly until I tried created my database. When running rake db:create I get a response saying that it coul...

Rake aborted! Incorrect database name?

I was hoping to run some unit tests but this is what I am getting. The internets are silent on the issue. Rails 2.1 Let me know if there is any other info that would help. mike@sleepycat:~/projects/myapp$ rake test:units --trace (in /home/mike/projects/myapp) ** Invoke test:units (first_time) ** Invoke db:test:prepare (f...

Configuring and running Ruby-On-Rails migrations

Hi, I'm (completely) new to ROR and have got an application to maintain and upgrade. I've the source code and am trying to build database using db:migrate rake command. I've started using Aptana Studio for the development. When I run dg:migrate I get following errors: rake db:migrate (in G:/Projects/.../.../trunk) MissingSourceFile no s...

Rails Rake Tasks, output a message during and at the end.

Hi, I've made a rails rake task that uploads/crops/re-sizes (with paperclip) silly amounts of images. I wanted to know how to output a message to the terminal when it was running (e.g. chipolata.jpg processed) and at the end, it takes a good few minutes to run and a little feedback would be good. Thanks. ...

Rescue RuntimeError in Rake

I have a custom Rakefile which calls different file tasks. Sometimes a file that is expected doesn't exist, and rake throws a RuntimeError and fails. However, I'd like to do a few things before it fails. So is there any way I could rescue a RuntimeError? Or is there some sort of a magic task which gets called before a complete fail? ...

Interactive task scheduler recommendations?

Hey folks, I am looking for something to manage and schedule the execution of rake tasks, like database backups or running reports; something that has a nice web interface so I don't have to use cron. I'm looking at hudson, but it seems this is more geared toward CI builds. Rather than roll my own, does anyone have any recommendations on...

puts vs logger in rails rake tasks

In a rake task if I use puts command then I see the output on console. However I will not see that message in log file when app is deployed on production. However if I say Rails.logger.info then in development mode I see nothing on console. I need to go to log file and tail that. I would ideally like to use Rails.logger.info and in dev...

Ruby Enterprise Edition - Rake not found

Hi, I've just had a new VPS set up and have installed Passenger with Ruby Enterprise Edition. However, I can't get rake to work. /opt/ruby-enterprise-1.8.7-2010.01/bin/gem list * LOCAL GEMS * actionmailer (2.3.5, 2.2.3) actionpack (2.3.5, 2.2.3) activerecord (2.3.5, 2.2.3) activeresource (2.3.5, 2.2.3) activesupport (2.3.5, 2.2.3) fa...

Using Rake on a gem with dependencies

I have a gem that requires a 'Cms' namespace to be present when running. However, when running rake tasks, nothing works as this Cms namespace isn't present. How do I get my rake tasks to work? ...

When working with gems in Rails, what does 'cannot remove Object::ClassMethods' stem from?

Frequently I have run into a problem when installing gems that provides a problem like: Does anyone know what this stems from? I've seen in it several different cases, yet still haven't learned what exactly is causing it. $ sudo rake gems:install --trace (in /u/app/releases/20100213003957) ** Invoke gems:install (first_time) ** Invoke ...

Need help with Sprouts (Ruby + RubyGems + AS3) - can't rake

So I'm trying to use Sprouts for AS3. I've installed Ruby and I've installed RubyGems, and I'm able to create a new project using "sprout -n as3 MyProject" - that builds fine. However, when I enter into that folder and type "rake" it errors out with the message "Could not find RubyGem win32-open3 (= 0.2.5)" I've googled around a little...

First time rails install, help with gems/rake

Hello all, I just did a first time ruby enterprise edition, installed some gems, and now I'm trying to do a ' sudo ./rake gems:install' and getting a: rake aborted! No Rakefile found error. Firstly, what directory should I be doing this from? Here are the steps I've followed: download ruby enterprise from http://www.rubyenter...

Are there ruby gems out there with SCons type features?

For kicks, I'm setting up the build process of my C++ program using rake. I'd rather not reinvent the wheel, however. Are there any ruby gems that have build features similar to the cool ones in SCons (e.g., C++ dependency detection, md5 difference detection, cross-platform pathing, multi-threading, etc.)? ...

rake db:migrate throws undefined method 'symbolize_keys' for nil:NilClass

Working with rails for the first time and I getting a rake error when I try: rake db:migrate RAILS_ENV=staging The Error: (in [my current directory]) rake aborted! undefined method `symbolize_keys' for nil:NilClass Has anyone seen this? ...

Can a Rake task on Heroku time out?

I'm using Heroku and would like to have a script (on another server) called via cron that periodically requests an action on my Heroku app. This action will in turn run some processing that may take 1 or 2 minutes to complete. I believe Heroku has 30 second request limit, I was thinking could call a Rake task from my controller action ...