Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Andrew Hunt
RE: win32/api Installation / usage issues [ reply ]  
2009-06-10 03:11
Thanks. This seems to have fixed that problem. Running into others now around running a java app asynchronously. Switching to ruby for a while.

Andrew

By: Park Heesob
RE: win32/api Installation / usage issues [ reply ]  
2009-06-09 07:22
As far as I know, the win32-api doesn't support jRuby officially yet.

But, if you really want to test win32-api,
download http://rubyforge.org/frs/download.php/57723/win32-api-1.4.2.zip and extract /lib/jruby/win32/api.rb to an appropriate folder, then try it.


Regards,

Park Heesob

By: Andrew Hunt
win32/api Installation / usage issues [ reply ]  
2009-06-09 05:41
Hi
Sorry - am brand new to jRuby. Trying to follow an example about some RSPEC testing and failing at their Win32API example.

Tried a jruby -s gem install win32-api and getting an error about 'Failed to build gem native extension.' Trawled a little more and found that I can download. Did this and expanded the zip into 'C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/' and copied the gemspec file into the specifications directly [have also renamed in attempt to remove warning].

Per the README, replaced their require 'Win32API' with the two:
require 'win32/api'
include Win32

and reran. Now getting following warnings/errors:
C:\TEST>jruby -S spec -r app -fs test_01.rb
WARNING: File 'C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/specifications/win32-api-1.4.2.gemspec' does not evaluate to a gem specification
C:/Program Files/jRuby/jruby-1.2.0/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require': no such file to load -- win32/api (LoadError)
from C:/Program Files/jRuby/jruby-1.2.0/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from app.rb:11
from app.rb:31:in `require'
from C:/Program Files/jRuby/jruby-1.2.0/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/option_parser.rb:149:in `invoke_requires'
from C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/option_parser.rb:148:in `each'
from C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/option_parser.rb:148:in `invoke_requires'
from C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/gems/rspec-1.2.6/lib/spec/runner/option_parser.rb:104:in `initialize'
... 8 levels...
from C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/gems/rspec-1.2.6/bin/spec:4
from C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/gems/rspec-1.2.6/bin/spec:19:in `load'
from C:\Program Files\jRuby\jruby-1.2.0\bin\..\bin\spec:19

Env details:
Windows XP
C:\TEST>jruby -S gem env
WARNING: File 'C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8/specifications/win32-api-1.4.2.gemspec' does not evaluate to a gem specification
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.1
- RUBY VERSION: 1.8.6 (2009-03-16 patchlevel 287) [java]
- INSTALLATION DIRECTORY: C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8
- RUBY EXECUTABLE: C:/Program Files/jRuby/jruby-1.2.0/bin/../bin/jruby.bat
- EXECUTABLE DIRECTORY: C:/Program Files/jRuby/jruby-1.2.0/bin/../bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-java-1.5
- GEM PATHS:
- C:/Program Files/jRuby/jruby-1.2.0/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--env-shebang"
- "update" => "--env-shebang"
- REMOTE SOURCES:
- http://gems.rubyforge.org/

Any assistance offered greatly appreciated.

Andrew