Require failes for win32/clipboard

Hello, all!

In Win32::Clipboard version 0.4.3 (installed via the OneClick
intstaller 1.8.6-26), I get the following error:

c:/ruby/lib/ruby/gems/1.8/gems/win32-clipboard-0.4.3/lib/win32/
clipboard.rb:25: uninitialized constant Win32::clipboard::Win32API
(NameError)
from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
32:in gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 32:inrequire’
from test_clipboard.rb:1

Line 1 in test_clipboard.rb is just:
require ‘win32/clipboard’

I get the same problem with the test script included with the
Win32::Clipboard gem. Any ideas what’s wrong here?

I’ve found the solution myself: You have to require Win32API first.

This does the trick:

require ‘Win32API’
require ‘win32/clipboard’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs