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

jruby and watir classic compatibility #3212

Closed
murathptest opened this issue Aug 3, 2015 · 3 comments
Closed

jruby and watir classic compatibility #3212

murathptest opened this issue Aug 3, 2015 · 3 comments

Comments

@murathptest
Copy link

I'm a novice to ruby and jruby. When I tried to install watir-classic gem with jruby 9.0.0.0 (2.2.2), I'm seeing the following error. I'm trying to enable the native c extensions. Through I found some past discussions, it is not clear to me if it is even possible to enable c extension with Jruby 9.0.0.0 Ruby 2.2.2 (32-bit). The following is the error

jruby -S gem install watir-classic-4.2.0.gem

Building native extensions. This could take a while...
C:/jruby9000/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:39: warning: Tempf
ile#unlink or delete called on open file; ignoring
ERROR: Error installing watir-classic-4.2.0.gem:
ERROR: Failed to build gem native extension.

C:/jruby9000/bin/jruby.exe -r ./siteconf20150802-2152-7x84rx.rb extconf.rb

jruby: warning: unknown property jruby.cext.enabled
jruby: warning: unknown property jruby.cext.enabled
NotImplementedError: C extensions are not supported
at C:/jruby9000/lib/ruby/stdlib/mkmf.rb:1

require at org/jruby/RubyKernel.java:940
(root) at C:/jruby9000/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
at extconf.rb:7

extconf failed, exit code 1

Gem files will remain installed in C:/jruby9000/lib/ruby/gems/shared/gems/win32-
api-1.4.8 for inspection.
Results logged to C:/jruby9000/lib/ruby/gems/shared/extensions/universal-java-1.
8/2.2.0/win32-api-1.4.8/gem_make.out

Thank you inadvance for any information you can give me.

@kwando
Copy link

kwando commented Aug 3, 2015

AFAIK usage of C-extensions is discouraged in jruby, https://github.com/jruby/jruby/wiki/C-Extension-Alternatives

@murathptest
Copy link
Author

Kwando, thank you for the reply. However, there are so many useful gems out there that require c language support one way or the other. there is also a very good article here...though I could NOT replicate the results (and this article is 5 years old...) I am not savy enough to know if what is discussed here is applicable to Jruby 9.0.0.0 with (Ruby 2.2.2) 32-bit.
http://jonforums.github.io/ruby/2010/11/30/devkit-jruby-c-extensions.html

I ran into issues, as I was trying to replicate his steps. Though everything he/she discussed made sense.

Any other comments from Ruby/Jruby experts are highly appreciated.

@kares
Copy link
Member

kares commented Aug 7, 2015

there sure are plenty C-style gems but usually the really good and popular ones provide a -java (JRuby) specific gem version these days (e.g. nokogiri). the other alternative to relying on MRI's C internals is to use FFI to link to C libraries. this is the path JRuby has taken and C-extensions simply won't work in 9K, sorry.

@kares kares closed this as completed Aug 7, 2015
@kares kares added this to the Invalid or Duplicate milestone Aug 7, 2015
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

3 participants