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

Discussion in 'Ruby' started by thufir, Apr 21, 2008.

  1. thufir

    thufir Guest

    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
     
    thufir, Apr 21, 2008
    #1
    1. Advertising

  2. Hi --

    On Mon, 21 Apr 2008, thufir wrote:

    > 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!
     
    David A. Black, Apr 21, 2008
    #2
    1. Advertising

  3. thufir

    thufir Guest

    On Mon, 21 Apr 2008 09:45:05 +0900, David A. Black wrote:


    >> task :run => :compile :cat do

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



    Ah, thanks!


    -Thufir
     
    thufir, Apr 21, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. krishlal925
    Replies:
    2
    Views:
    5,320
    joris
    Apr 1, 2011
  2. Slain Wilde
    Replies:
    1
    Views:
    119
    Gerald Murray
    Aug 9, 2006
  3. John Gabriele
    Replies:
    1
    Views:
    165
    Suraj Kurapati
    Dec 5, 2006
  4. Alec Williams
    Replies:
    2
    Views:
    316
    Stefano Crocco
    Jul 19, 2009
  5. Louise Rains
    Replies:
    4
    Views:
    480
    Louise Rains
    Aug 11, 2010
Loading...

Share This Page