plessl / wkpdf

A command line HTML to PDF converter for Mac OS X

Home Page:http://plessl.github.com/wkpdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot load RubyCocoa library

opened this issue · comments

Cannot load RubyCocoa library
wkpdf requires that RubyCocoa is installed, which is shipped by default since
Mac OS X 10.5. If you use Mac OS X 10.4, you have to install RubyCocoa
yourself from http://rubycocoa.sourceforge.net/HomePage

I'm on OSX 10.8.2 using rvm installed it to global ruby1.9.3-P194

Sorry, but I cannot provide any help with that. I have no experience with a manual installation of RubyCocoa. Since OS X has started to bundle RubyCocoa there is no need to install it by hand anymore.

But shouldn't it be able to find the installed bundle ?

On 10 Jan 2013, at 11:52, Christian Plessl notifications@github.com wrote:

Sorry, but I cannot provide any help with that. I have no experience with a manual installation of RubyCocoa. Since OS X has started to bundle RubyCocoa there is no need to install it by hand anymore.


Reply to this email directly or view it on GitHub.

Yes, it should. This is why this looks more like a RubyCocoa problem than a wkpdf problem to me.

Are you able to run one of the sample scripts shipped with RubyCocoa?

What happens for example if you save the following script (from the RubyCocoa examples) to a file fontnames.rb and run it with ruby fontnames.rb?

require 'osx/cocoa'

fmgr = OSX::NSFontManager.sharedFontManager

puts "## all fonts ##"
fonts = fmgr.availableFonts.to_a.map{|i| i.to_s }
fonts.each {|i| puts i }

puts "## fixed pitch fonts ##"
fixedfonts =
  fmgr.availableFontNamesWithTraits(OSX::NSFixedPitchFontMask).to_a
fixedfonts.each {|i| puts i.to_s }

Sorry to bother you with this but I'm quite new to Ruby

/Users/stofke/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- osx/cocoa (LoadError) from /Users/stofke/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from Untitled.rb:1:in `

'

On 10 Jan 2013, at 12:05, Christian Plessl notifications@github.com wrote:

require 'osx/cocoa'

fmgr = OSX::NSFontManager.sharedFontManager

puts "## all fonts ##"
fonts = fmgr.availableFonts.to_a.map{|i| i.to_s }
fonts.each {|i| puts i }

puts "## fixed pitch fonts ##"
fixedfonts =
fmgr.availableFontNamesWithTraits(OSX::NSFixedPitchFontMask).to_a
fixedfonts.each {|i| puts i.to_s }

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm

Thank you for looking into this. I'll try that suggestion

Kind regards,

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.

Unfortunately I have no idea what the problem could be. But for what reason do you want to use rvm? RubyCocoa and wkpdf work just fine with the default Ruby installation shipped with OS X 10.7 and 10.8, probably also 10.6.

On 15.01.2013, at 15:59, Kristof Polleunis notifications@github.com wrote:

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

Actually I don't know how to switch to the default Ruby installation, without removing rvm?

On 15 Jan 2013, at 22:35, Christian Plessl notifications@github.com wrote:

Unfortunately I have no idea what the problem could be. But for what reason do you want to use rvm? RubyCocoa and wkpdf work just fine with the default Ruby installation shipped with OS X 10.7 and 10.8, probably also 10.6.

On 15.01.2013, at 15:59, Kristof Polleunis notifications@github.com wrote:

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

rvm use system (see https://rvm.io/rubies/default/)

On 15.01.2013, at 22:41, Kristof Polleunis notifications@github.com wrote:

Actually I don't know how to switch to the default Ruby installation, without removing rvm?

On 15 Jan 2013, at 22:35, Christian Plessl notifications@github.com wrote:

Unfortunately I have no idea what the problem could be. But for what reason do you want to use rvm? RubyCocoa and wkpdf work just fine with the default Ruby installation shipped with OS X 10.7 and 10.8, probably also 10.6.

On 15.01.2013, at 15:59, Kristof Polleunis notifications@github.com wrote:

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

Christian Plessl, Am Hilligenbusch 18, 33098 Paderborn, Germany
christian@plesslweb.ch http://plesslweb.ch +49-5251-5089512

I'm almost there it installed well but still one error left to squash

RubyGems installed the following executables:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

[]$ sudo gem install wkpdf
Fetching: trollop-2.0.gem (100%)
Fetching: wkpdf-0.6.9-universal-darwin.gem (100%)
Successfully installed trollop-2.0
Successfully installed wkpdf-0.6.9-universal-darwin
2 gems installed
[
]$ gem update wkpdf
Updating installed gems
Nothing to update
[~]$ wkpdf --source http://www.apple.com --output apple.pdf
env: ruby_noexec_wrapper: No such file or directory

On 15 Jan 2013, at 22:35, Christian Plessl notifications@github.com wrote:

Unfortunately I have no idea what the problem could be. But for what reason do you want to use rvm? RubyCocoa and wkpdf work just fine with the default Ruby installation shipped with OS X 10.7 and 10.8, probably also 10.6.

On 15.01.2013, at 15:59, Kristof Polleunis notifications@github.com wrote:

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

I don't have any idea. A quick google search pointed out bundler, rubygems of rvm as possible sources for this error. But debugging this is beyond the support I can offer.

On 15.01.2013, at 23:58, Kristof Polleunis notifications@github.com wrote:

I'm almost there it installed well but still one error left to squash

RubyGems installed the following executables:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

[]$ sudo gem install wkpdf
Fetching: trollop-2.0.gem (100%)
Fetching: wkpdf-0.6.9-universal-darwin.gem (100%)
Successfully installed trollop-2.0
Successfully installed wkpdf-0.6.9-universal-darwin
2 gems installed
[
]$ gem update wkpdf
Updating installed gems
Nothing to update
[~]$ wkpdf --source http://www.apple.com --output apple.pdf
env: ruby_noexec_wrapper: No such file or directory

On 15 Jan 2013, at 22:35, Christian Plessl notifications@github.com wrote:

Unfortunately I have no idea what the problem could be. But for what reason do you want to use rvm? RubyCocoa and wkpdf work just fine with the default Ruby installation shipped with OS X 10.7 and 10.8, probably also 10.6.

On 15.01.2013, at 15:59, Kristof Polleunis notifications@github.com wrote:

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

Christian Plessl, Am Hilligenbusch 18, 33098 Paderborn, Germany
christian@plesslweb.ch http://plesslweb.ch +49-5251-5089512

No problem, I won't take up more of your time, you have been very helpful. I came across that same thing via google but couldn't make head or tails from it. I'll uninstall rvm eventually and see if that helps.

On 16 Jan 2013, at 09:22, Christian Plessl notifications@github.com wrote:

I don't have any idea. A quick google search pointed out bundler, rubygems of rvm as possible sources for this error. But debugging this is beyond the support I can offer.

On 15.01.2013, at 23:58, Kristof Polleunis notifications@github.com wrote:

I'm almost there it installed well but still one error left to squash

RubyGems installed the following executables:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

[]$ sudo gem install wkpdf
Fetching: trollop-2.0.gem (100%)
Fetching: wkpdf-0.6.9-universal-darwin.gem (100%)
Successfully installed trollop-2.0
Successfully installed wkpdf-0.6.9-universal-darwin
2 gems installed
[
]$ gem update wkpdf
Updating installed gems
Nothing to update
[~]$ wkpdf --source http://www.apple.com --output apple.pdf
env: ruby_noexec_wrapper: No such file or directory

On 15 Jan 2013, at 22:35, Christian Plessl notifications@github.com wrote:

Unfortunately I have no idea what the problem could be. But for what reason do you want to use rvm? RubyCocoa and wkpdf work just fine with the default Ruby installation shipped with OS X 10.7 and 10.8, probably also 10.6.

On 15.01.2013, at 15:59, Kristof Polleunis notifications@github.com wrote:

Sorry to bother you once more, I followed the suggestions in that link until I hit another error, fixed that also until I hit another one did fix that too but now I'm stuck, I wonder if you have any ideas what this is all about

dyld: lazy symbol binding failed: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

dyld: Symbol not found: _RBRubyCocoaInit
Referenced from: /Users/stofke/.rvm/rubies/ruby-1.8.7-p371/lib/ruby/site_ruby/1.8/i686-darwin12.2.1/rubycocoa.bundle
Expected in: flat namespace

Trace/BPT trap: 5

Kristof Polleunis
On 10 Jan 2013, at 13:09, Christian Plessl notifications@github.com wrote:

As I suspected, it looks like RubyCocoa is not properly installed in your rvm setup.

Maybe this is of help:

http://rbxbx.tumblr.com/post/556343148/install-rubycocoa-on-rvm


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub.

Christian Plessl, Am Hilligenbusch 18, 33098 Paderborn, Germany
christian@plesslweb.ch http://plesslweb.ch +49-5251-5089512

Reply to this email directly or view it on GitHub.

@Stofke72 I had the same issue. Try this:

  • Uninstall the gem: sudo gem uninstall wkpdf
  • Reinstall using the non-rvm gem: sudo /usr/bin/gem install wkpdf

@mastahyeti Thanks. It works.

I had the same problem. I have OS X 10.8.3

Cannot load RubyCocoa library
wkpdf requires that RubyCocoa is installed, which is shipped by default since
Mac OS X 10.5. If you use Mac OS X 10.4, you have to install RubyCocoa
yourself from http://rubycocoa.sourceforge.net/HomePage

So I followed mastahyeti,

Uninstall the gem: sudo gem uninstall wkpdf
Reinstall using the non-rvm gem: sudo /usr/bin/gem install wkpdf

But I get an error as following. Anyone knows how to fix it? Thank you in advance.

sudo /usr/bin/gem install wkpdf
Successfully installed trollop-2.0
Successfully installed wkpdf-0.6.10-universal-darwin
2 gems installed
Installing ri documentation for trollop-2.0...
Installing ri documentation for wkpdf-0.6.10-universal-darwin...
Installing RDoc documentation for trollop-2.0...
Installing RDoc documentation for wkpdf-0.6.10-universal-darwin...
➜ Downloads wkpdf --source http://www.apple.com --output apple.pdf
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in report_activate_error': Could not find RubyGem wkpdf (>= 0) (Gem::LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:inactivate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /usr/bin/wkpdf:18

Is rvm really deactivated for your environment?

Is /usr/bin/gem a symlink and where does it point to (ls -l /usr/bin/gem)?

On my installation it points to: ../../System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem

Using wkpdf with non-default Ruby installations is not supported.

More info regarding this issue: rbenv/rbenv#270.