HTTPS clone URL
Subversion checkout URL
- ActiveRecord JDBC
- C Extension Alternatives
- Concurrency in jruby
- Concurrency in JRuby: Opening a class
- Contribution Guide
- Developing with JRuby Truffle
- Embedding with bsf
- Embedding with JSR 223
- Gems known not to be threadsafe
- Getting started
- Google Summer of Code 2013
- Google Summer of Code 2014
- Google Summer of Code 2015
- Improving Memory Consumption
- Improving startup time
- In Your Region
- Integrating with Scala
- Integration With JVM Languages
- JRuby 184.108.40.206.pre1 Release Notes
- JRuby Books
- JRuby Build Some Inside Info
- Jruby on Rails on Oracle Weblogic
- Jruby on rails with spring
- JRuby Performance profile
- JRuby Reference
- JRuby Scripting container in Servlet using Gems packed with Maven
- Jruby Scripting container using Gems with a Maven Project
- LoadService loading mechanism
- Main page
- Maven Artifact of JRuby (for maven, ivy, buildr, and alike)
- Optimization Ideas
- Packaging Native Installers with the JavaFX Ant Tasks
- Profiling jruby
- Profiling Object Allocations
- Rack Application with JBundler on Heroku
- Rack Application with Ruby Maven
- RailsMulti ThreadingBestPractices
- Roadmap (January2007 June2007)
- Ruby in Research
- Running Minitest or Rspec over serveral JRuby versions with Ruby Maven
- RunningRailsWithActiveRecord JDBC
- Security in JRuby
- Troubleshooting Memory Use
- Truffle Module
- Updating timezone data
- Using a different Bouncy Castle version via JBundler
- Using Drip with JRuby
- Using Eclipse with JRuby Truffle
- Using Maven libraries from JRuby
Clone this wiki locally
Although ideally MRI and JRuby would behave 100% the same in all situations, there are some minor differences. Some differences are due to bugs, and those are not reported here. This page is for differences that are not bugs.
JRuby cannot run native C extensions. Popular libraries have all generally been ported to Java Native Extensions. Also, now that FFI has become a popular alternative to binding to C libraries, using it obviates the need to write a large chunk of native extensions.
Fibers (a form of delimited continuation) are supported on JRuby, but each fiber is backed by a native thread. This can lead to resource issues when attempting to use more fibers than the system allows threads in a given process.
On Microsoft Windows, JRuby is a little smarter when launching external processes. If the executable file is not a binary executable (
.exe), MRI requires you give the file suffix as well, but JRuby manages without it.
For example, say you have file
foo.bat on your PATH and want to run it.
system( 'foo' ) # works on JRuby, fails on MRI system( 'foo.bat' ) # works both in JRuby and MRI
JRuby doesn't implement
fork() on any platform, including those where
fork() is available in MRI. This is due to the fact that most JVMs cannot be safely forked.
Since the JVM presents a compatible CPU to JRuby, the native endianness of JRuby is Big Endian. This does matter for operations that depend on that behavior, like
Array#pack for formats like
Since it is not possible to obtain
usec precision under a JVM,
Time.now.usec cannot return values with microsecond precision.
> Time.now.usec => 582000
Keep this in mind when counting on
usec precision in your code.
JRuby only has one regular expression engine, which matches Onigurama's behavior. It is not changed in --1.8 mode, so code depending on regular expressions behaving precisely as on MRI 1.8.n may fail on JRuby in --1.8 mode. For instance:
ruby-1.8.7-p302 > "a".match(/^(.*)+$/) => "a" jruby-head > "a".match(/^(.*)+$/) => ""
NOTE: from at least as early as JRuby 1.7.6, Ruby thread priorities are mapped to Java thread priorities, so this section isn't accurate -- you can use the same priority for MRI and JRuby.
In MRI, the Thread priority can be set to any value in Fixnum (if native threads are enabled) or -3..3 (if not). The default value is 0.
In JRuby, Threads are backed by Java threads, and the priority ranges from 1 to 10, with a default of 5. If you pass a value outside of this range to
Thread#priority=, the priority will be set to 1 or 10.
JRuby is not able to rescue from
SystemStackError. If your code rely on this, you should rather try to catch a
Java::JavaLang::StackOverflowError. See this ticket for further information.