Prawn gem nil:NilClass error that doesn't occur in MRI
------------------------------------------------------
Key: JRUBY-3579
URL: http://jira.codehaus.org/browse/JRUBY-3579
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.2
Environment: Windows XP SP3, JRuby 1.2.0, RubyGems 1.3.1, Prawn 0.4.1
Reporter: Brandon Hauff
Assignee: Thomas E Enebo
Fix For: JRuby 1.2
I am using the Prawn gem to create some PDFs. When trying to embed a font I
get an error with JRuby that does not occur with MRI. The simplest case to
reproduce this is shown below:
require 'rubygems'
gem 'prawn'
require 'prawn'
Prawn::Document.generate("test.pdf") do
font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf"
text "This is a test!!!"
end
In MRI this worked fine. In JRuby 1.2.0 I got the following error:
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/font/ttf.rb:259:in
`embed': undefined method `code_map' for
nil:NilClass (NoMethodError)
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/font/ttf.rb:222:in
`register'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/reference.rb:27:in
`call'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/reference.rb:27:in
`object'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document/internals.rb:95:in
`render_body'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document/internals.rb:93:in
`each'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document/internals.rb:93:in
`render_body'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:175:in
`render'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:189:in
`render_file'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:189:in
`open'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:189:in
`render_file'
from
C:/jruby-1.2.0/lib/ruby/gems/1.8/gems/prawn-0.4.1/lib/prawn/document.rb:59:in
`generate'
from prawn_test.rb:5
Thanks,
Brandon
--
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