rake "can't convert Class into String" when line 2421 in rake.rb calls
Java::JavaUtilJar::JarInputStream,to_s
-------------------------------------------------------------------------------------------------------------
Key: JRUBY-3538
URL: http://jira.codehaus.org/browse/JRUBY-3538
Project: JRuby
Issue Type: Bug
Components: Core Classes/Modules
Affects Versions: JRuby 1.2, JRuby 1.3
Reporter: Stephen Bannasch
Priority: Critical
I've got a gem for working with jnlp resources I'm working on and I can no
longer use hoe with it.
To even use hoe with JRuby I first need to apply this patch.
* http://gist.github.com/87670
But the problem comes in line 2421 on rake.rb when it tries to call to_s.
Also see possibly related issue [JRUBY-3486].
Here's one way to reproduce it.
{code}
# hpricot 0.6.164 is a dependency of the gem I am building
jruby -S gem install hpricot -v0.6.164
git clone [email protected]:stepheneb/jnlp.git
cd jnlp
jruby -S rake --T --trace
{code}
On my MacOS X 10.5.6 system hat results in this:
{code}
rake aborted!
can't convert Class into String
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2425:in
`load_imports'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2366:in
`raw_load_rakefile'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1993:in
`load_rakefile'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
`standard_exception_handling'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1992:in
`load_rakefile'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1976:in
`run'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in
`standard_exception_handling'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in
`run'
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31
/Users/stephen/dev/ruby/src/jruby.git/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:19:in
`load'
/Users/stephen/dev/ruby/src/jruby.git/bin/rake:19
{code}
Here's he code in rake.rb
{code}
# Load the pending list of imported files.
def load_imports
while fn = @pending_imports.shift
next if @imported.member?(fn)
if fn_task = lookup(fn)
fn_task.invoke
end
ext = File.extname(fn)
loader = @loaders[ext] || @default_loader
loader.load(fn)
@imported << fn
end
end
{code}
Instrumenting the code just before the exception shows that fn has a value of
Java::JavaUtilJar::JarInputStream and indeed that particular instance won't
respond to :to_s.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email