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

Provide informative errors on load of Ruby stdlibs we can't support #4195

Open
headius opened this issue Sep 30, 2016 · 1 comment
Open

Provide informative errors on load of Ruby stdlibs we can't support #4195

headius opened this issue Sep 30, 2016 · 1 comment

Comments

@headius
Copy link
Member

headius commented Sep 30, 2016

Today there are still a number of standard Ruby libraries that we don't support, usually due to their dependence on C extensions or libraries not easily called from a JVM language. I propose that instead of omitting these libraries entirely, we should have stub files in our stdlib that present a more informative error. Something like this:

$ jruby -e 'require "gdbm"'
LoadError: gdbm is not supported on JRuby.
Suggested alternatives: JavaDB, HSQL, HypersonicDB

   <main> at /Users/headius/projects/jruby/lib/ruby/stdlib/gdbm.rb:1
  require at org/jruby/RubyKernel.java:956
   (root) at /Users/headius/projects/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
   <main> at -e:1

The alternatives could be hardcoded or somehow sourced from https://github.com/jruby/jruby/wiki/C-Extension-Alternatives

Here's a short list of the stdlib exts we don't support: dbm, gdbm, objspace, sdbm, tk. There may be others, and there may be subcomponents of mostly-Ruby libraries that are native and not supported in JRuby right now.

@brauliobo
Copy link

+1. Would be useful for SDBM too

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

2 participants