Loading sketchup gem prawn

hello everyone,
i need your help fr an urgent matter.
i installed the ruby gem “prawn” on sketchup 64bit and when i use require ‘prawn’ in my sketchup extension it works fine, but on another PC with sketchup 32bit i installed the ruby gem prawn but when i use require ‘prawn’ it doesn’t work it gives me an error loading prawn.
What is the problem and why it works on my PC but not on the other ?
thnx a lot

You need to post the error message within a code block.

And what SketchUp version ?

i’m using sketchup 2016 and the error was something like:

unable to load prawn gem

When we ask for version number we need it in major.minor format, so like 16.0 or 16.1 ?

We would need the real full error message showing the error file and line number where the error occurred.

Something like” is no help.

1 Like

Please stay in one thread, instead of creating duplicates!

1 Like

yes i created the other one because it’s different this problem was because of versions 32 bit and 64 bit but the other one is for the same version of sketchuo 2016 64 bit and the versions of prawn is different 2.1.0 instead of 2.0.2, also for the other one i have the error message, so it’s not the same problem

We do not need two prawn topic threads.
Your topic titles are both general and do not differentiate between version, bitness nor error type.
In fact, in Ruby, require() and load() are near the same, as require() is a conditional loading, and load() will brute force re-load.

I am not going to jump back and forth between two general “prawn” topic threads.

Referring to the gem page:

What is prawn ?

Prawn is a fast, tiny, and nimble PDF generator for Ruby

Runtime Dependancies

pdf-core ~> 0.6.1
ttfunk ~> 1.4.0

Jean, Did these dependent packages install when prawn installed ?

At the console, I do:

Gem::install "prawn"
>> [
  #<Gem::Specification:0x4d95040 ttfunk-1.4.0>,
  #<Gem::Specification:0x4e64020 pdf-core-0.6.1>, 
  #<Gem::Specification:0x492701c prawn-2.1.0>


require "prawn"

and get true, (a normal load.)

Your other thread seems to indicate that “prawn.rb” cannot be found.
AND, that you have some string encoding error happening between the system encoding and UTF-8 encoding.

This all starts with some plugin file “SUP_PEB.rb” or some similar name.

Not sure as those screen shots are too small to read.
In the future please just cut and paste the error text, into a code block in the forum.

Check this plugin file to see if it is changing the default string encoding.

Without you posting actual code, we can only guess at what the error is.

@DanRathbun sorry again it’s just i’ve been blocked in this error for so long and tried a lot of solutions from the net but nothing works.

First i had when i require ‘prawn’ :

Error: #loaderror: cannot load such file – prawn >
c:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:110:in require' c:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:110:inrescue in require’
c:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/core_ext/kernel_require.reb:35:in require' C:/Users/m-mçoi/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/SUP_PEB.rb:27:inblock in module:PEB
Sketchup:i:in `call’

then i used require ‘C:/Users/m-mçoi/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Gems64/gems/prawn-2.1.0/lib/prawn.rb’ to find the gem, then i had the error above but for ttfunk this time and gave the full path to the require ‘ttfunk’ in the prawn.rb file, now i have this error:

Error: #Encoding:CompatibilityError: incompatible character encodings:UTF-8 and ASCII-8BIT>
C:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/specifications.rb:45:in require' C:/Program Files/SketchUp/SketchUp 2016/Tools/RubyStdLib/rubygems/specifications.rb:45:inrequire’
C:/Users/m-mçoi/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Plugins/SUP_PEB.rb:27:in block in <module:PEB>' Sketchup:i:incall’

the line 27 in the SUP_PEB.rb file that gives the error is this:

require ‘C:/Users/m-mçoi/AppData/Roaming/SketchUp/SketchUp 2016/SketchUp/Gems64/gems/prawn-2.1.0/lib/prawn.rb’

like it doesn’t see this path as an UTF-8 string or something i tried encode(‘UTF-8’) and force_encode(‘UTF-8’) but nothing worked.
if u can help it’ll be great and sorry again.

You have Unicode characters in your User %AppData% paths.

This can cause issues in some SketchUp versions, especially if you start SketchUp by double-clicking a SKP file.

Check $" (aka $LOADED_FEATURES ) to be sure that RubyGems has loaded it’s libraries.

To list the first ~50 members of $" at the console execute:

puts $"[0..50]

Also you can check if the gem paths are loaded into the ENV hash:


And your still not using code blocks correctly. (Those are quote blocks in the previous post.)

1 Like

oky thank you so much i’ll keep your advice in mind and i’ll test that and get back to you with the results

You do not ever need to do this.
There is something wrong with your installation.

The Ruby string encodings are not loading.

what can be wrong with the installation as i just followed the steps of the instalation then install the ruby gems using ruby console nothing more.
now the only error that appears is the encoding error for the line of the path, also how can i check my appdata path to check if i have “Unicode characters in your User %AppData% paths.”

Post the first 50 members of $" as I showed.
and the contents of $LOAD_PATH array by doing this:

puts $:

or go get the diagnostics plugin and create a diagnostics data file:

1 Like

oky i don’t have the PC where the problem exists for now, i’ll post the results tomorrow morning.

I know that they are there. I can see them in your posts. They are in your username.

From in SketchUp’s Ruby console:


From outside in a command shell window, type set

1 Like

oky thank you soo much for your answer and so sorry for the disturbing you, i’ll try all this tomorrow once i get to my other PC where the problem is happening and i’ll send you all the results of those commandes.
thnx a lot once again

Rather than a bunch of back and forth, I would really promote using the diagnostics plugin to collect all the information at once.

And just post the output file (from the diagnostics) here in the thread.

1 Like

@DanRathbun where can i find the diagnostics plugin as a Google search got me things like geometry or models diagnostics can you share a download link of it so as not to get the wrong one and have more problems. thnx a lot

I did , and use the latest version listed:

1 Like

how can i run the diagnostic i did download the latest version i put the su_diagnostics.rb and the folder su_diagnositcs in the plugins folder but it doesn’t appear anywhere in Sketchup menu ?