how to invoke a rake file

T

Thufir

How is this rakefile invoked?

C:\code>
C:\code>rake
(in C:/code)
rake aborted!
Don't know how to build task 'default'

(See full trace by running task with --trace)

C:\code>
C:\code>type rakefile.rb
alias :eek:riginal_directory :directory
def directory(dir)
original_directory dir
Rake::Task[dir]
end


namespace :utils do
task :create_directories => [
directory('public/icons'),
directory('public/images'),
directory('public/groups'),
]
end
C:\code>

from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

thanks,

Thufir
 
M

Michael Fellinger

How is this rakefile invoked?

C:\code>
C:\code>rake
(in C:/code)
rake aborted!
Don't know how to build task 'default'

(See full trace by running task with --trace)

C:\code>
C:\code>type rakefile.rb
alias :eek:riginal_directory :directory
def directory(dir)
original_directory dir
Rake::Task[dir]
end


namespace :utils do
task :create_directories => [
directory('public/icons'),
directory('public/images'),
directory('public/groups'),
]
end
C:\code>

from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial

[snip]
If I wanted to use Rake to call each of these tasks, I might create a
file called "Rakefile"
[/snip]
from:
http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial
 
M

Mark Ryall

[Note: parts of this message were removed to make it a legal post.]

try:
rake utils:create_directories
 
T

Thufir

[Note:  parts of this message were removed to make it a legal post.]

try:
rake utils:create_directories
[...]

Thanks, this worked on Windows :)


Why isn't it:

rake utils:create_directory


I thought it was just rails that did magic with plurals.




thanks,

Thufir
 
T

Thufir

"rakefile.rb" == "Rakefile"
# false
[...]

On my system at least rakefile.rb == Rakefile for these purposes.
Isn't that the case, or what did you mean? However, I wonder what
happens when there's rakefile.rb, Rakefile.rb and Rakefile as well as
rakefile and "rake" is run...


thufir@arrakis:~$
thufir@arrakis:~$ rake
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb,
Rakefile.rb)
/usr/lib/ruby/1.8/rake.rb:1840:in `load_rakefile'
(See full trace by running task with --trace)
thufir@arrakis:~$




-Thufir
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top