From: Lars Christensen Date: 2009-08-11T23:28:00+09:00 Subject: Re: fail to load the win32-api gem when running OCRA On Tue, Aug 11, 2009 at 3:58 PM, Manuel Souto Pico wrote: > Hi, > > I'm trying to run ocra but I seem to have a problem with win32-api. I'm > running this on cygwin and have also tried in an Ubuntu server. Running > ocra outputs an error that tells me to install win32-api, which I do, > but after that I still get the same error. > > I've also tried running ocra with --no-autodll option but then the > resulting exe file won't run. > === ERROR: Failed to load the win32-api gem. Install win32-api or use > --no-autod > ll. > === CAUSE: LoadError: Permission denied - > /usr/lib/ruby/gems/1.8/gems/win32-api- > 1.4.3-x86-mswin32-60/lib/win32/api.so OCRA tries to load win32-api using "require 'win32/api'". It looks like Ruby is trying to load the api.so library, but gets a permission error. This could be because the library is already open. How do you load it from your script? (Can you post a simple example script that reproduces the error?) What error do you get when using --no-autodll? Here is my sample script which works with ocra-1.1.2: require 'win32/api' exit if defined?(Ocra) Win32::API.new('MessageBox', 'LPPI', 'I', 'user32').call(0, "Hello, World!", "Greeting", 0) You are also welcome to ask your questions at http://rubyforge.org/forum/forum.php?forum_id=31710