[LRUG] Rake problem with gets

Roland Swingler roland.swingler at gmail.com
Tue Jun 13 07:49:31 PDT 2006


Hi all,

Good to meet some of you the other night - I should definitely try to
make more meetings. Also looking forward to the idea of a few hack
nights that John mused about.

Anyway, I have been doing some stuff with Rake at the moment, and have
run into a bug / something I don't understand - if anyone can shed any
light on the problem it would be much appreciated.

Here is my example rakefile:

task :getting do
  x = gets
  puts x
end

task :default => [:getting]

In my actual file I'm using the gets to confirm that you really want
to do some uploading after seeing what files have been changed. The
problem - running just "rake" on the command line works fine, waiting
for input - running "rake getting" gives me the following error:

rake aborted!
No such file or directory - getting
/home/rolands/tests/rakefile.rb:2:in `gets'
(See full trace by running task with --trace)

Doing the trace I get:

/home/rolands/tests/rakefile.rb:2:in `gets'
/home/rolands/tests/rakefile.rb:2
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'
/usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
/usr/local/bin/rake:18

The only thing I'm suspicious of is the Mutex synchronize method call
in line 135 - I know nothing about threading (in fact multithreading
is a subject I'd be interested in hearing a talk about) but am
guessing it might screw up input in some way?

Any thoughts or if anyone has run into a similar problem - it would be
great to hear. I'm running the stable snapshot version of ruby 1.8.4

Cheers,
Roland



More information about the Chat mailing list