similar to: How do I override a method that's only invoked from a rake task

Displaying 20 results from an estimated 20000 matches similar to: "How do I override a method that's only invoked from a rake task"

2007 Jan 21
6
rake db:migrate "undefined method `default'" error
Hi all, Just starting with Rails and working through the early chapters of the Pragmatic Programmers Agile Development with Rails book (2nd addition). When doing a "rake db:migrate" to add a column to a table I get this: undefined method `default'' for #<ActiveRecord::ConnectionAdapters::MysqlAdapter:0xb7517ec8> Any ideas? thanks, David PS: Here''s the full
2006 May 05
0
Perplexing unit test issue
Because we''re now using views, I had to upgrade to mysql 5 on a project using Rails 1.0. Updated my mysql gem accordingly (which required upgrading xcode). Ruby 1.8.2, MacOS X (10.4.6) Worked fine several times (even before updating the mysql gem, then suddenly it just balked and stopped working, giving the spew below. Have also dropped (and recreated) both the test and
2008 May 07
0
Calling a controller method with a rake task - plugin errors
I have a rake task to call a controller method: ------------------------------------- require ''action_controller'' require ''action_controller/integration'' namespace :backup do desc "Starts automated backup procedure for all databases" task "do_auto" do app = ActionController::Integration::Session.new; app.get
2006 Mar 29
2
Rake Migrations for Rails 1.1
Hi all. I keep having the following error when I invoke the rake db:migrate command for Rails 1.1 (Ruby 1.8.2 -- Windows 2000) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == Realtorex: migrating ======================================================= -- create() rake aborted! undefined method `create'' for
2010 Nov 09
2
Undefined method
I am very new to ROR. (Ruby 1.8.7, rails 2.1.1, rack 0.8.7, mysql 5.1.41) I has my_app/lib/migration_helpers.rb file: module MigrationHelpers def self.foreign_key(from_table, from_column, to_table) constraint_name = "fk_#{from_table}_#{to_table}" execute %{alter table #{from_table} add constraint #{constraint_name} foreign key (#{from_column})
2010 Feb 25
0
Rails problems running rake and other tasks - undefined method `action_controller'
I suddenly have a major problem in all my Rails 3 apps: $ rake db:migrate --trace rake aborted! Don''t know how to build task ''db:migrate'' /Users/kristianconsult/.rvm/gems/ruby-1.9.1-p378/gems/rake-0.8.7/lib/ rake.rb:1728:in `[]'' /Users/kristianconsult/.rvm/gems/ruby-1.9.1-p378/gems/rake-0.8.7/lib/ rake.rb:2050:in `invoke_task''
2005 Jan 22
2
What''s with the tests?
Am I the only one with this problem: I create a new app using "rails appname". I create a dev database, a table, then generate a model for the table and a controller for the app. The app works in the browser. I can create objects, and so forth. Then I create a test database, and run "rake", which says: rake aborted! undefined method `+'' for nil:NilClass
2007 Dec 26
2
How to set environment when calling rake task inside another
This is what I have inside a rake task. In this rake task I need to call another rake task called email:send_messages. However I need to pass the RAILS_ENV as ''staging''. Rake::Task["rake:email:send_messages"].invoke I tried a lot of variations but none of them work. Rake::Task["rake:email:send_messages"].invoke RAILS_ENV=staging
2006 Oct 22
0
[705] trunk/wxruby2/rake/rakedocs.rb: Add rake task to publish docs to wxruby website (Alex Fenton)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2007 Dec 07
4
mrblog rake task fails
Hi all, I''m trying to run the mrblog sample application but somehow the rake task fails: -- Los-Angeles:~/Projects/mrblog Ulf$ rake db:schema:load --trace (in /Users/Ulf/Projects/mrblog) rake aborted! Don''t know how to build task ''db:schema:load'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]''
2007 Oct 12
0
Speccing a rake task
Greetings, I''m writing a custom rake task, and I''d like to write an assosciated spec for it. Does anyone have an example spec for a rake task? I''ve seen some examples on the web that use these before blocks: before(:each) do @rake = Rake::Application.new Rake.application = @rake end And use @rake["db:user_migration"].invoke To invoke the
2006 Apr 18
0
extend doc:app rake task to Include lib/*?
I''ve never really done much with rake and I''m trying to figure out how to add some options to the doc:app task. For instance I''d like to include documentation for files in the lib directory. I can''t seem to figure out the proper way to do it short of changing the lib/tasks/documentation.rake in the rails distribution. After poking around in the rails tasks, I
2013 Feb 28
0
Rake tasks db:test:prepare cannot be executed in the same task of db:reset or db:migrate
Hey all, I''m trying to create a task that prepare the environment to start programming. To do so, I created a task like this *task :setup_env => [''db:reset'', ''db:migrate'', ''db:test:prepare'']* and observed that after execute * rake setup_env*, it never execute db:test:prepare properly. In order to get the schema cloned to test db,
2006 Aug 11
1
Absolute path to public/images in rake task?
Hi all I''m trying to create a rake task for the first time, so please be a bit patient with me. ;-) I''m coding a photo gallery. Every photo gallery''s photos are in its own folder, and after an update I''d like to be able to synchronize the photo files with the database (because every photo has its own Photo class object). I''ve got so far: # File
2009 Mar 06
2
rake test:functionals -> Task not supported by ''
I have a Rails project in which I''ve been using "rake test" tasks with great success. At some point (there were a few changes in the interim), rake started aborting test tasks. Here is the dialog: === $ rake test:functionals (in /Users/fritza/myproject) rake aborted! Task not supported by '''' (See full trace by running task with --trace) === The separate
2005 Dec 26
0
Rake (default task) overwrites development database?
I changed the subject to be more appropriate. Any idea why the development database would be effected? On 12/26/05, Ryan Wood <ryan.wood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > Hey all. Hope you can help with this. I was running "rake" to run > tests on my server we are setting up for production. I''m currently > entering all my data into the dev
2013 Jul 01
0
Rake task like "rake cache_digests:dependencies" for Rails 4?
The cache_digests gem has the "rake cache_digests:dependencies" task for checking template dependencies. Since Rails 4 includes this caching scheme by default, should it include a similar rake task? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send
2010 Oct 06
3
Script acting differently inside of rake task
I''ve created a rake task that does various things, one of which is calling a script. When I call that script from my Rails.root folder, it works, but it doesn''t work inside my rake task. [This is rails 3] That is, the following line works from bash: lib/daemons/mailer_ctl start However, inside my rake task, this line does not work: puts `lib/daemons/mailer_ctl start` The
2011 May 25
1
rake task: uninitialized constant
I have this rake taks: CUSTOM_MONTHS = [nil, "GEN", "FEB", "MAR", "APR", "MAG", "GIU", "LUG", "AGO", "SET", "OTT", "NOV", "DIC"] def parse_date_string(date_string) begin day, month, year = date_string.split("-") Time.mktime(year, CUSTOM_MONTHS.index(month),
2006 May 09
2
Disabling FOREIGN KEYs in a Rake task
Hi, How could I disable my database FOREIGN KEYs in a Rake task? Or, how could I call the execute() method in a Rake task? I''m trying to perform something like: task :delete_the_cippalippa => :environment do require RAILS_ROOT+''/lib/marsian.rb'' # FIXME: execute() is undefined execute "SET FOREIGN_KEY_CHECKS = 0" Cippalippa.delete(-1)