-
Notifications
You must be signed in to change notification settings - Fork 0
C Extension Alternatives
JRuby versions prior to 1.6 did not support Ruby C extensions, and even in 1.6 the support is still "in development" and considered experimental. As of 1.7, it has been disabled and will likely be removed.
This page lists common C extensions and non-C alternatives you can use to replace them.
-
RDiscount - Use kramdown, Maruku (pure Ruby) or markdown_j (wrapper around a Java library)
-
RMagick - Try RMagick4J (implements ImageMagick functionality in Java) or preferably use alternatives mini_magick & quick_magick. For simple resizing, cropping, greyscaling, etc look at image_voodoo.
-
Unicorn - Try any one of the following JRuby-based servers: Trinidad, Mizuno, Kirk, mobile or Puma (though make sure to use the JRuby-native version of the gem).
-
Thin - Thin might compile and run but is not recommended. Try any one of the following JRuby-based servers: Trinidad, Mizuno, Kirk, TorqueBox or Puma.
-
Typhoeus - The C extension doesn't currently compile. There's no equivalent library for JRuby, but you might try any of the pure-Ruby HTTP clients (
net/http
, httpclient, etc.). There are also several Java HTTP client libraries that will work (Apache HttpClient, HttpURLConnection, etc). Update: As of May 2012, Typheous works under JRuby. (I would delete this item from the list, but taking the conservative path.) -
mysql - Use activerecord-jdbc-adapter instead along with
jdbc-mysql
. -
mysql2 - Use activerecord-jdbc-adapter instead along with
jdbc-mysql
. -
sqlite3 - Use activerecord-jdbc-adapter instead along with
jdbc-sqlite3
. -
Nokogiri - For best results, use the pure-Java version of Nokogiri (default after v1.5).
-
yajl-ruby - Try
json
,json_pure
, oroj
instead. Unfortunately there is no known equivalent JSON stream parser. -
bson_ext -
bson_ext
isn't used with JRuby. Instead, some native Java extensions are bundled with thebson
gem. -
win32ole - Use the
jruby-win32ole
gem (preinstalled in JRuby's Windows installer). -
curb - Rurl is an example how to implement some of curb's functionality using Apache HttpClient
-
therubyracer - Try using therubyrhino instead.
-
kyotocabinet - Try using kyotocabinet-java instead. This isn't 100% complete yet, but it covers most of the API.
-
memcached - Try using jruby-memcached instead. Alternatively you can use jruby-ehcache, a JRuby interface to Java's (JSR-107 compliant) Ehcache.
Please add to this list with your findings.
Note that the JRuby-Lint gem parses the contents of the list above to use for its Ruby gem checker. In order for JRuby-Lint to use the information, please adhere to the gem_name - instructions
format.