rake

Using rake with Teamcity gives a RegexError

Every time that I try use team city to build a .net solution using rake I receive the same "Format_exception_msg : Invalid escape character syntax: /path to rakefile/ (RegexError) My natural assumption would be that I in fact have a invalid escape character somewhere in my rake code, I admit that I've never used ruby or rake before, but...

Can I override task :environment in test_helper.rb to test rake tasks?

I have a series of rake tasks in a Rakefile which I'd like to test as part of my specs etc. Each task is defined in the form: task :do_somthing => :environment do # Do something with the database here end Where the :environment task sets up an ActiveRecord/DataMapper database connection and classes. I'm not using this as part of Rai...

Why does rake db:migrate in Rails not add functions to the schema file?

I recently added some SQL functions to my database via a migrate, and they work perfectly fine. Code works, database works, tests don't. The schema.rb file is telling me that it's at the latest version (and it's correct), but it only contains definitions for tables and indexes, not the functions I added. I added the functions via the ...

Rake not running properly in cronjob

Hi, I have a rake file, which can be executed successfully at command line. When I set a cronjob to run this rake file, the line "require 'json'" fails. My guess is that cronjob has a different env variable. It doesn't work when I tried to put "puts ENV" in the ruby script. So I'm wondering what I should do to check the different env var...

Is there a better way to run a capistrano task from within rake?

I have a set of rake tasks where I need to invoke capistrano at some point. Edwin Goei's blog suggests shelling out to capistrano via "sh". Is there a simpler way? It would seem you should be able to call the appropriate tasks programmatically. Thanks in advance. ...

Maintaining Persistence When Using Rake Tasks

I'm running some basic continuous integration scripts in the form of rake tasks, using cron to automate their running. I'd like to be able to maintain some form of state between tasks however. I've considered just writing information to a file and reading it back in. Is there a more "ruby" way of doing this? ...

What steps are followed after you say "rake install"?

I'd like to install a plugin but I'm afraid it's going to install a lot of unnecessary stuff. I'd like to look at whatever file rake takes it installation instructions from and remove anything unnecessary. I believe this is the Rakefile. But I'm not sure what happens when rake looks at the rakefile - does it execute the entire rakefile ...

Error running rake task from IDE

I am having a problem running the 'test' Rake task from IntelliJ Idea in Ruby On Rails application: *Error running test: File 'test/unit/autorunner.rb' wasnt found in $LOAD_PATH of Ruby SDK with interpreter: '{1}'* But the file is located at %RUBY_HOME%/lib/ruby/1.8/test/unit and I have no problems when running other rake tasks. Plea...

(RAILS) Looping a Custom Rake every 2 mins, Bad Idea? Better way to implement?

I've currently created a custom rake file that does the following: 1.) Checks an External Feed for "NEW" Items 2.) For each new item in the feed array,it updates my Database with a new record 3.) I've currently got it on a WHILE loop. The while loop has an (@loopcheck) instance variable that is set to true initially, and if any ex...

How to quickly initialize ruby project development environment?

How to specify gem dependencies in a way that user with only ruby, rake and rubygems installed could issue a single rake command to install all the dependencies required? Is it possible to use the same dependency specification when building gem with GemBuildTask? ...

Ruby on Rails: Problem installing gitorious in Ubuntu 9.0.4

I seem unable to install Gitorious. I am trying not to install Ruby Enterprise Edition, but apart from that I have been following the instructions for Ubunut (there were some errors but I have gotten around those). I have installed a number of missing packages and gems, but now I am stuck when I try to migrate the database. I get the fol...

exactly what does rake db:migrate do?

Does rake db:migrate only add new migrations, or does it drop all migrations/changes and build everything new? I think rake is throwing an error because it is trying to access a table attribute in migration 040 that was deleted in migration 042. somehow my DB and rake are out of synch and I want to fix them. for you experts out there -...

How do I use a custom log for my rake tasks in Ruby on Rails?

I have a rake task that calls functions like this: namespace :blah do task :hello_world => :environment do logger.info("Hello World") helloworld2 end end def helloworld2 logger.info("Hello Again, World") end I want the log output to a custom log, and I really don't want to have to pass a log reference every t...

rake db:test:load not working

i am working on a project that requires Rails 1.2.6. I am setting up my first test environment, but i get a "rake aborted! Don't know how to build task 'db:test:load'" when i try "rake db:test:load." is this command only for Rails 2.x? do i need to use a deprecated command? ...

Ruby on Rails: gem not found even though it is installed

I get this error trying to run any Ultrasphinx rake commands (under Linux terminal) such as rake ultrasphinx:configure : rake aborted! no such file to load -- echoe /var/www/gitorious/vendor/plugins/ultrasphinx/Rakefile:2:in `require' /var/www/gitorious/vendor/plugins/ultrasphinx/Rakefile:2 /usr/lib/ruby/1.8/rake.rb:2359:in `load' /us...

Gem path used by rake different than system path on OS X

> gem env gempath /Users/davec/.gem/ruby/1.8:/opt/local/lib/ruby/gems/1.8 > head Rakefile require 'rubygems' puts Gem.path require 'rake/clean' require 'rake/testtask' require 'rcov' require 'rcov/rcovtask' > rake /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 /Library/Ruby/Gems/1.8 rake aborted! no such f...

How do I force RAILS_ENV in a rake task?

I have this little rake task: namespace :db do namespace :test do task :reset do ENV['RAILS_ENV'] = "test" Rake::Task['db:drop'].invoke Rake::Task['db:create'].invoke Rake::Task['db:migrate'].invoke end end end Now, when I execute, it will ignore the RAILS_ENV I tried to hard-code. How do I mak...

How to prevent Rake test to call task db:test:prepare

Every time I want to run Rake test the task db:test:prepare is being called and it rebuilds my test environment database from schema.rb and migrations. What I would like to achive is to disable the call of db:test:prepare when I want to test make Rails application. Is it possible without modifying Rails gem? ...

How is Capistrano related to Rake?

I'm starting to read up on Capistrano after using Rake tasks to deploy apps for a long time. It's really striking how similar it is to Rake. A lot of parallel commands (like cap -T) and a lot of identical concepts (namespaces, tasks). Does anyone know the history behind that? Is Capistrano an extension of Rake, or built on top of it? ...

Version number generation using rake

On previous projects I've used Nant but want to try out Rake on a new project. With Nant I used the Version task in nantcontrib that generates a Version number for you. Is there anything similar out there for doing this using Rake? ...