rakefile gives syntax error, unexpected ':', expecting $end

T

thufir

I want to make run dependant on the compile and cat tasks, but don't seem
to have the syntax quite correct:

thufir@arrakis:~/foo$
thufir@arrakis:~/foo$ rake run
(in /home/thufir/foo)
rake aborted!
/home/thufir/foo/rakefile.rb:3: syntax error, unexpected ':', expecting
$end
task :run => :compile :cat do
^

(See full trace by running task with --trace)
thufir@arrakis:~/foo$
thufir@arrakis:~/foo$ cat rakefile.rb


task :run => :compile :cat do
system("java ArrayOfStrings")
end

task :cat do
system("cat ArrayOfStrings.java")
end


task :compile => :clean do
system("javac ArrayOfStrings.java")
end


task :clean do
FileUtils.rm_rf("*.class")
end
thufir@arrakis:~/foo$



thanks,

Thufir
 
D

David A. Black

Hi --

I want to make run dependant on the compile and cat tasks, but don't seem
to have the syntax quite correct:

thufir@arrakis:~/foo$
thufir@arrakis:~/foo$ rake run
(in /home/thufir/foo)
rake aborted!
/home/thufir/foo/rakefile.rb:3: syntax error, unexpected ':', expecting
$end
task :run => :compile :cat do
^

(See full trace by running task with --trace)
thufir@arrakis:~/foo$
thufir@arrakis:~/foo$ cat rakefile.rb


task :run => :compile :cat do

Try this:

task :run => [:compile, :cat] do


David

--
Rails training from David A. Black and Ruby Power and Light:
INTRO TO RAILS June 9-12 Berlin
ADVANCING WITH RAILS June 16-19 Berlin
INTRO TO RAILS June 24-27 London (Skills Matter)
See http://www.rubypal.com for details and updates!
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top