Comments on: creating a custom rake task /2009/12/creating-a-custom-rake-task/ Sarah Allen's reflections on internet software and other topics Mon, 25 Sep 2017 20:40:20 +0000 hourly 1 https://wordpress.org/?v=5.7.1 By: Wellington Torrejais da Silva /2009/12/creating-a-custom-rake-task/#comment-6495 Mon, 25 Sep 2017 20:40:20 +0000 /?p=2236#comment-6495 Thanks!

]]>
By: Aaron /2009/12/creating-a-custom-rake-task/#comment-1491 Wed, 04 Dec 2013 21:47:12 +0000 /?p=2236#comment-1491 sorry my comment was it should be:

heroku run rake db:migrate

(replace colon with a space between rake and db)

]]>
By: Aaron /2009/12/creating-a-custom-rake-task/#comment-1490 Wed, 04 Dec 2013 21:46:21 +0000 /?p=2236#comment-1490 The latest version of Heroku add “run” to the command. Therefore:

%> heroku run rake:db:migrate

instead of:

%> heroku rake:db:migrate

]]>
By: Sarah /2009/12/creating-a-custom-rake-task/#comment-644 Tue, 22 Nov 2011 17:18:48 +0000 /?p=2236#comment-644 In reply to Aravind.

:task_name => :environment will load the Rails environment, which will allow you to access things like your ActiveRecord models or Rails config. Without that you can just run pure Ruby code.

]]>
By: Aravind /2009/12/creating-a-custom-rake-task/#comment-643 Tue, 22 Nov 2011 15:51:52 +0000 /?p=2236#comment-643 Thank you for your post…

Could you tell me the significance of :environment in :task_name => :environment. what happens if i vomit this :environment ?

]]>
By: SSCirrus /2009/12/creating-a-custom-rake-task/#comment-642 Tue, 02 Aug 2011 06:29:51 +0000 /?p=2236#comment-642 This is a very helpful post, thank you for writing it!

Are there any significant updates to the above methodology you are aware of for Rails 3?

]]>
By: Ray /2009/12/creating-a-custom-rake-task/#comment-641 Sun, 20 Dec 2009 19:36:20 +0000 /?p=2236#comment-641 If you want your greet task to appear when you do ‘rake -T’ you need to add a description.

Also if you envision doing ‘rake gems:install’ at any point to you should move ‘require faker’ into the body of a task. Otherwise if you run ‘rake gems:install’ without faker installed, rake will fail. Here you could put it as the first line of your ‘fake_people’ task but you could also create a ‘require_faker’ task that did the require and was a dependency of ‘require_people’.

]]>