Improving the JRuby toolchain

January 31, 2014 Alex Kwiatkowski

Recently we’ve seen an uptick in JRuby projects coming through the door, especially with our enterprise clients. This has been both a blessing and a curse. On the one hand we have to leave our familiar and reliable MRI environment, on the other we still get to use our skills and tools from the Ruby ecosystem. I’ve been really encouraged with the feature parity of JRuby and look forward to the enterprise considering it as a legitimate solution.

That said, we did run into a couple of gotchas for some of the gems we depend on. We make heavy use of capybara-webkit for headless acceptance testing and it didn’t explicitly have JRuby support. Luckily there were only a couple of failing tests and we could call on maintainer and ex pivot Matt Horan for some guidance. With his help we managed to:

Fix killing webkit server when a test suite completes
Fix some failing IO tests
Get a passing JRuby build up an running on travis

A couple of projects also use warbler to create standard .war packages that can be deployed on Tomcat. Warbler and git sourced gems need a little extra config to play nice. We were seeing the following error:

Bundler::GitError: https://github.com/gregbell/active_admin.git (at master) is not yet checked out. Run `bundle install` first.

It turns out that warbler 1.4.0 overrides GEM_HOME by default. Combined with RVM this was the root of our problem. The following simple config tweak ensures warbler builds the package and looks in the correct paths when executed:

   # config/warble.rb
   Warbler::Config.new do |config|
      # ...
      config.override_gem_home = false
   end

About the Author

Biography

More Content by Alex Kwiatkowski
Previous
Remote Dependencies, Convenience, Risk and Other Considerations for Operating Distributed Systems
Remote Dependencies, Convenience, Risk and Other Considerations for Operating Distributed Systems

One deeply held principle by experienced distributed system operators that I have worked with is that you ...

Next
The Big Data Story (and Webinar) Behind Chinese New Year
The Big Data Story (and Webinar) Behind Chinese New Year

Gong Xi Fa Cai! This is the greeting heard by half the world today, as we welcome in the Chinese New Year. ...

Enter curious. Exit smarter.

Learn More