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

Missing dependency on ruby devkit? #2038

Closed
pacey opened this issue Oct 10, 2014 · 4 comments
Closed

Missing dependency on ruby devkit? #2038

pacey opened this issue Oct 10, 2014 · 4 comments

Comments

@pacey
Copy link

pacey commented Oct 10, 2014

Trying to use jruby to install gems on windows. But it throws an error as it cant find the "make" executable. It looks like this resides in the ruby devkit so am I meant to install this and add it to the path? Or should jruby have a dependency on the ruby devkit?

@tduehr
Copy link
Contributor

tduehr commented Oct 10, 2014

C based extension support in JRuby is experimental. Gems requiring non ruby extensions that support JRuby usually have a Java based extension for use under JRuby.

Installing JRuby under the ruby devkit – as you would any other windows ruby – should work to get your C extensions compiling on windows, assuming they support Windows themselves.

You best bet is to find a Java or pure ruby version of the gems you're trying to install.

@rtyler
Copy link

rtyler commented Aug 7, 2015

@pacey which gems are you trying to install on Windows? Can you try this again with more recent versions of JRuby?

As @tduehr mentioned, C-based native extension support in JRuby isn't very well supported and sometimes gem developers will not account for the Windows platform when building their extconf.rb files.

@preetpalS
Copy link

@rtyler Just try to install the fast-stemmer gem (jruby -S gem install fast-stemmer) which is installed as a dependency by anyone trying to install the sciruby-full gem when using JRuby.

I can confirm that installing this gem is an issue for JRuby (using 9.1.7.0) on all platforms (tested on macOS and Windows).

The error that JRuby on Windows (64-bit) produces when trying to install a gem with a native C-based extension is kind of weird in that it does not even attempt to use make even when it is available, whereas on macOS it does use make but fails saying that there is no rule to build /usr/local/Cellar/jruby/9.1.7.0/libexec/lib/ruby/include/ruby/ruby.h. Ideally JRuby would recognize gems with native extensions and give the user a message that it cannot install them.

I included the error messages produced by JRuby on Windows when trying to install the fast-stemmer gem below:

C:\Rubies\Devkit-mingw64-64-4.7.2-20130224-1432-sfx\bin>make
make: *** No targets specified and no makefile found.  Stop.

C:\Rubies\Devkit-mingw64-64-4.7.2-20130224-1432-sfx\bin>jruby -S gem install fast-stemmer
Building native extensions.  This could take a while...
C:/jruby-9.1.7.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:56: warning: Tempfile#unlink or delete called on open file; ignoring
ERROR:  Error installing fast-stemmer:
        ERROR: Failed to build gem native extension.

    current directory: C:/jruby-9.1.7.0/lib/ruby/gems/shared/gems/fast-stemmer-1.0.2/ext
C:/jruby-9.1.7.0/bin/jruby.exe -r ./siteconf20170113-12540-8ndee3.rb extconf.rb
creating Makefile

current directory: C:/jruby-9.1.7.0/lib/ruby/gems/shared/gems/fast-stemmer-1.0.2/ext
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.

current directory: C:/jruby-9.1.7.0/lib/ruby/gems/shared/gems/fast-stemmer-1.0.2/ext
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.

make failed, exit code 1

Gem files will remain installed in C:/jruby-9.1.7.0/lib/ruby/gems/shared/gems/fast-stemmer-1.0.2 for inspection.
Results logged to C:/jruby-9.1.7.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/fast-stemmer-1.0.2/gem_make.out

C:\Rubies\Devkit-mingw64-64-4.7.2-20130224-1432-sfx\bin>

@headius
Copy link
Member

headius commented Jan 13, 2017

JRuby does not support C extensions and we have no plans to do so in the immediate future. If you need fast-stemmer your path forward would be to use a pure-Ruby version, a version ported to JRuby's extension API, or a JVM-based stemmer library (which you can call from Ruby easily).

The experimental JRuby+Truffle runtime has early support for C exts, so that may be an option in the future.

@headius headius closed this as completed Jan 13, 2017
@headius headius added this to the Won't Fix milestone Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants