Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load RubyCocoa library #36

Closed
ghost opened this issue Jan 10, 2013 · 19 comments
Closed

Cannot load RubyCocoa library #36

ghost opened this issue Jan 10, 2013 · 19 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2013

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

@plessl
Copy link
Owner

plessl commented Jan 10, 2013

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.

@ghost
Copy link
Author

ghost commented Jan 10, 2013

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.

@plessl
Copy link
Owner

plessl commented Jan 10, 2013

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 }

@ghost
Copy link
Author

ghost commented Jan 10, 2013

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 }

@plessl
Copy link
Owner

plessl commented Jan 10, 2013

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

@ghost
Copy link
Author

ghost commented Jan 10, 2013

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.

@ghost
Copy link
Author

ghost commented Jan 15, 2013

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.

@plessl
Copy link
Owner

plessl commented Jan 15, 2013

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.

@ghost
Copy link
Author

ghost commented Jan 15, 2013

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.

@plessl
Copy link
Owner

plessl commented Jan 15, 2013

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

@ghost
Copy link
Author

ghost commented Jan 15, 2013

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.

@plessl
Copy link
Owner

plessl commented Jan 16, 2013

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

@ghost
Copy link
Author

ghost commented Jan 16, 2013

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.

@btoews
Copy link

btoews commented Jan 25, 2013

@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

@nickcheng
Copy link

@mastahyeti Thanks. It works.

@ghost
Copy link
Author

ghost commented Jun 3, 2013

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

@plessl
Copy link
Owner

plessl commented Jun 4, 2013

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

@plessl
Copy link
Owner

plessl commented Jul 3, 2013

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

@plessl plessl closed this as completed Jul 3, 2013
@enure
Copy link

enure commented Aug 2, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants