OK, I got took one of the first examples of the website I cited before, > >http://jasonseifer.com/2010/04/06/rake-tutorial and found that it didn't work "in any directory" as advertised.
I did three things: 1 Upgraded the example so that it would work "in any directory" (I suspect it would work in the root dir.) 2. Added command[echoing code 3. Remove spurious quotes from the argument of the echo command. Comments in the Rakefile below spell out all the details if you're interested. Thanks for nudging me forward. Best wishes, Richard Rakefile ====== directory "tmp" # Creates subdirectory "tmp" of the working directory # Src: http://jasonseifer.com/2010/04/06/rake-tutorial # Store this file (Rakefile) and Rake01.bat in: # K:\_Projects\Ruby\_Rails_Apps\_EIMS\Tools\RakeExamples\Example01 # Invoke this Rakefile with the command Rake01.bat: # :Session Rake01 # K: # cd K:\_Projects\Ruby\_Rails_Apps\_EIMS\Tools\RakeExamples\Example01 # rake hello.tmp verbose(true) do file "hello.tmp" => "tmp" do sh "echo Hello >> #{File.join(getwd, 'tmp/hello.txt')}" end end # Text of original example: =begin directory "tmp" file "hello.tmp" => "tmp" do sh "echo 'Hello' >> 'tmp/hello.tmp'" end =end # which produces =begin K:\_Projects\Ruby\_Rails_Apps\_EIMS\Tools\RakeExamples\Example01>rake hello.tmp echo 'Hello' >> 'tmp/hello.tmp' (in K:/_Projects/Ruby/_Rails_Apps/_EIMS/Tools/RakeExamples/Example01) The system cannot find the path specified. rake aborted! Command failed with status (1): [echo 'Hello' >> 'tmp/hello.tmp'...] K:/_Projects/Ruby/_Rails_Apps/_EIMS/Tools/RakeExamples/Example01/ rakefile:9 (See full trace by running task with --trace) >Exit code: 1 =end On Jul 9, 6:28 pm, Hassan Schroeder <[email protected]> wrote: > On Fri, Jul 9, 2010 at 2:42 PM, RichardOnRails > > <[email protected]> wrote: > > I got an example rakefile from the webpage > >http://jasonseifer.com/2010/04/06/rake-tutorial > > which displays "Published: April 6, 2010 at 4:25 AM" > > > Below are my results from testing that rakefile in a Command window on > > WinXP-Pro/SP3 running Rails 2.3.5, where Rake complained "Don't know > > how to build task 'default'". How do I get it to run as I intend? > > K:\Temp>type rakefile > > s/b Rakefile, though possibly case doesn't matter on Windows -- > you can confirm or disprove that, but in any case, > > > K:\Temp>rake > > that's not how it's invoked in the tutorial you cite. Look again. > > > (in K:/Temp) > > rake aborted! > > Don't know how to build task 'default' > > Or add a default task :-) > > A glance at the Rake rdoc should help, eh? :-) > -- > Hassan Schroeder ------------------------ [email protected] > twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

