rake

Run rake task in controller

Hi all, I'd like to run a rake task in my controller. Is there any way to do this? Thanks, Sophy, ...

CruiseControl.rb: running cruise rake task with current revision as parameter

Hi, when CruiseControl.rb wants to perform an integration test it looks for a rake task called "cruise" within the project and executes it. Is there a way to hand over the current revision number to that task? I'm deploying an app using capistrano on a remote machine after integration tests. Because capistrano will deploy the HEAD rev...

Accessing a Plugin from a Rake Task

How would I go about accessing the Bundle-Fu plugin from this rake task? I have tried everything out and nothing seems to work. Note: assets_javascript & assets_css are both arrays of files that are pulled from a central location to keep this rake task and the view DRY. desc "Generate cached css/js files" task :asset_cache_genera...

How can I migrate my database with rails to the first revision without dropping the database first?

I have a database set up for my Rails installation and some migrations set up. I would like to be able to reset my database back down to having no tables/constraints/etc., but can't find a reasonable way to do this without knowing the number of migrations or the timestamp of the first migration. Here are my options as I see them: rake ...

Run rake task from outside RAILS_ROOT

Hi, My RAILS_ROOT is /usr/local/www/application/ If I run 'rake db:migrate RAILS_ENV=production" from within the RAILS_ROOT it works fine. However I can't seem to find a way to run the same command from outside the RAILS_ROOT. Help is appreciated. Many Thanks ...

How to tell whether you are in a rake task or not

I have a default scope set in my model. However, when I call a particular model function from my rake task, I don't want the scope to be in effect. So, when my model is loaded, how can I tell if it was loaded within a rake task or not. ...

When I run any "rake" command, I get: uninitialized constant Gem::Specification::PLATFORM_CROSS_TARGETS [solved]

Hello, After installing RedCloth, I can not run any "rake" -tasks. I get: rake aborted! uninitialized constant Gem::Specification::PLATFORM_CROSS_TARGETS Here's output of rake routes --trace Versions: Rake - 0.8.4 Rails - 2.3.2 Ruby - 1.8.7 RedCloth - 4.2.2 Gem - 1.3.5 the Rakefile: `require(File.join(File.dirname(FILE), 'co...

Rails migration question

I have 4 related migrations in my Rails app: First 3 migrations create one table each in the self.up and and drops them in their respective self.down methods. 4th migration runs a rake task that loads data to all three (in self.up). I am thinking what to put in self.down of this migration to delete the rows from the 3 tables? Am I doi...

how do i get teamcity to pick up my nunit tests run from rake?

when i run this: sh "#{MBUNIT_PATH}Gallio.Echo.exe /no-echo-results src/#{dll}/bin/Debug/#{dll}.dll" in my rakefile, gallio runs my mbunit tests, and TC picks up the results :D but this: sh "#{NUNIT_PATH}nunit-console.exe /nologo src/#{dll}/bin/Debug/#{dll}.dll" does run my tests, but TC doesnt pick up the result :( I first tried...

Very strange problem with Gettext and Haml on Rails / rake updatepo broke

Hi, I'm on Rails 2.3.3 and using Haml 2.0.9 for my templates and Gettext-Rails 2.0.4 for the translation. Haml works like a charm and gettext is also working like it should. But I cant get Gettext to parse Haml Files when using "rake updatepo". I created a custom parser like this: # lib/haml_parser.rb require 'gettext_rails/tools' req...

Rails : Rake Test:functionals cannot access DB (Sqlite3 on winXP)

Hi, I am unable to run rake test:functionals with SQLite3, it gives me this error : rake aborted! Permission denied - db/test.sqlite (See full trace by running task with --trace) My setup is on Windows XP. Tests were working a few weeks ago. Rails 2.3.2, Rake 0.8.7, sqlite3-ruby 1.2.5 gems I am using Netbeans for development, but e...

First Rails Project: Rake Problem

I'm running rails on Mac OS X. I think I installed it correctly, but I'm getting the following error. $ rake db:create (in /Users/user_name/myapp) rake aborted! Could not find RubyGem mocha (>= 0) (See full trace by running task with --trace) What is the problem? How do I fix it? ...

Ruby on rails: rubygem error

I having a problem: $ rake db:create (in /Users/devinross14/myapp) rake aborted! RubyGem version error: rake-compiler(0.6.0 not ~> 0.5.0) (See full trace by running task with --trace) How do I fix this? ...

Test Rake Tasks

I am developing a ROR app that relies on many custom Rake tasks. What is the best way to test them? ...

Teamcity and Rake: Where are the tc system properties?

I'm converting some of my NAnt build scripts over to rake. Does anyone know how to access the system properties (e.g. build.number) inside my rake scripts? Is the Teamcity rake plugin even injecting them? I can't seem to find the doco. ...

Ruby on rails: Rake Migrate Help

I'm trying to do a rake migrate, but I'm getting an error when I do this: rake db:migrate What I get back: rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2377:in `raw_load_rakefile' (See full trace by running task with --trace) How do I ...

Rails: gettext pot generation task generates empty files

Hello, my problem is that in my app I want to generate the gettext .pot file with rake but I'm getting a file with no keys, only the header text ("Some descriptive title. Copyright (C)..."). I'm using the task gettext:find getttext_18n_rails. I tried before with the classic updatepo task but was the same. Perhaps am I missing any gem? ...

How would I invoke a rake script inside my rails application?

I want to execute a rake script from within a model. Beside calling it via backtick, is there anyway to include the rake library and call Rake::Task['some_task'].invoke. ...

What is the standard way to dump db to yml fixtures in rails?

I've seen some plugins and custom rake tasks to dump the active db to fixtures, but I'm not sure what the prevailing technique is. Basically, I want the opposite of rake:db:fixtures:load so that I can put basic db information (the admin user account, for one) into svn for when we deploy. I don't want to have to create fixtures manually ...

db:schema:load vs db:migrate with capistrano

Hi, I have a rails app that I'm moving to another server and I figure I should use db:schema:load to create the mysql database because it's recommended. My problem is that I'm using capistrano to deploy and it seems to be defaulting to rake db:migrate instead. Is there a way to change this or is capistrano using db:migrate for a good re...